mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
* Add lite-serve with VSCode launcher * Make lite-serve smarter to work with Basic authtype as well * Change and unify app-config-replace script
27 lines
597 B
JavaScript
27 lines
597 B
JavaScript
const { createLogger, transports, format } = require('winston');
|
|
const { yellow, green, red, blue, magenta, cyan } = require('chalk');
|
|
|
|
const levels = {
|
|
error: red,
|
|
warn: yellow,
|
|
info: cyan,
|
|
verbose: magenta,
|
|
debug: green,
|
|
silly: blue
|
|
};
|
|
|
|
const myFormat = format.printf(({ level, message, label, timestamp }) => {
|
|
return `[${levels[level](timestamp)}]: ${message}`;
|
|
});
|
|
|
|
module.exports = createLogger({
|
|
level: 'silly',
|
|
format: format.combine(
|
|
// format.splat(),
|
|
format.timestamp(),
|
|
format.prettyPrint(),
|
|
myFormat
|
|
),
|
|
transports: [new transports.Console()]
|
|
});
|