spee.ch/server/helpers/configureLogger.js
2018-03-16 10:34:26 -07:00

24 lines
698 B
JavaScript

const { logLevel } = require('../../config/loggerConfig');
module.exports = (winston) => {
// configure
winston.configure({
transports: [
new (winston.transports.Console)({
level : logLevel,
timestamp : false,
colorize : true,
prettyPrint : true,
handleExceptions : true,
humanReadableUnhandledException: true,
}),
],
});
// test all the log levels
winston.error('Level 0');
winston.warn('Level 1');
winston.info('Level 2');
winston.verbose('Level 3');
winston.debug('Level 4');
winston.silly('Level 5');
};