forest-express
Version:
Official package for all Forest Express Lianas
44 lines (43 loc) • 1.02 kB
JavaScript
;
var winston = require('winston');
var CONFIG = {
levels: {
error: 0,
debug: 1,
warn: 2,
data: 3,
info: 4,
verbose: 5,
silly: 6
},
colors: {
error: 'red',
debug: 'blue',
warn: 'yellow',
data: 'grey',
info: 'green',
verbose: 'cyan',
silly: 'magenta'
}
};
var TITLE = '[forest] 🌳🌳🌳 ';
winston.addColors(CONFIG.colors);
module.exports = winston.createLogger({
transports: [new winston.transports.Console({
format: winston.format.combine(winston.format.metadata({
fillExcept: ['level', 'message']
}), winston.format.printf(function (info) {
var message = TITLE + info.message;
if (info.metadata && Object.keys(info.metadata).length) {
message += "\n".concat(JSON.stringify(info.metadata, null, 2));
}
if (info.stack) {
message += "\n".concat(info.stack);
}
return message;
}), winston.format.colorize({
all: true
}))
})],
levels: CONFIG.levels
});