Fix no console logging. #1218

This commit is contained in:
Koen Kanters 2019-03-09 21:36:07 +01:00
parent 5f19d9cc82
commit 1e1e0e4ca9

View File

@ -30,9 +30,9 @@ const logger = new winston.Logger({
new winston.transports.Console({
timestamp: () => new Date().toLocaleString(),
formatter: (options) =>
winston.config.colorize(options.level, ` zigbee2mqtt:${options.level.toLowerCase()}`)
+ ` ${options.timestamp()} ${options.message || ''}`
+ options.meta && Object.keys(options.meta).length ? '\n\t'+ JSON.stringify(options.meta) : '',
winston.config.colorize(options.level, ' zigbee2mqtt:' + options.level.toLowerCase()) + ' ' +
options.timestamp() + ' ' + (options.message ? options.message : '') +
(options.meta && Object.keys(options.meta).length ? '\n\t'+ JSON.stringify(options.meta) : '' )
}),
],
});