2017-03-14 01:02:43 -04:00
|
|
|
'use strict'
|
2019-05-30 18:27:56 -04:00
|
|
|
const { createLogger, format, transports } = require('winston')
|
2015-06-01 06:04:25 -04:00
|
|
|
|
2018-11-16 05:42:52 -05:00
|
|
|
const logger = createLogger({
|
2018-11-13 17:29:33 -05:00
|
|
|
level: 'debug',
|
|
|
|
format: format.combine(
|
|
|
|
format.uncolorize(),
|
|
|
|
format.timestamp(),
|
|
|
|
format.align(),
|
|
|
|
format.splat(),
|
|
|
|
format.printf(info => `${info.timestamp} ${info.level}: ${info.message}`)
|
|
|
|
),
|
2017-03-08 05:45:51 -05:00
|
|
|
transports: [
|
2018-11-13 17:29:33 -05:00
|
|
|
new transports.Console({
|
|
|
|
handleExceptions: true
|
2017-03-08 05:45:51 -05:00
|
|
|
})
|
|
|
|
],
|
|
|
|
exitOnError: false
|
|
|
|
})
|
2018-11-16 05:42:52 -05:00
|
|
|
|
|
|
|
logger.stream = {
|
|
|
|
write: function (message, encoding) {
|
|
|
|
logger.info(message)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = logger
|