spee.ch/server/helpers/configureLogger.js

25 lines
701 B
JavaScript
Raw Normal View History

2018-03-19 23:34:32 +01:00
const { logLevel } = require('../../devConfig/loggerConfig');
2018-03-09 20:20:13 +01:00
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');
};