diff options
author | Sheogorath | 2018-11-13 23:29:33 +0100 |
---|---|---|
committer | Sheogorath | 2018-11-14 00:47:11 +0100 |
commit | c3584770f24205d84b9399abd9535cb27dc7b00c (patch) | |
tree | e86baadf379199a78286c49565650abbae2723aa /lib/logger.js | |
parent | 54d3d930cf39c2a3bec422d858cbac20ad8118eb (diff) |
Upgrade winston
Our log library got a new major version which should be implemented.
That's exactly what this patch does. Implementing the new version of the
logging library.
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
Diffstat (limited to '')
-rw-r--r-- | lib/logger.js | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/lib/logger.js b/lib/logger.js index f8b3895c..c70b81b8 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -1,23 +1,19 @@ 'use strict' -const winston = require('winston') +const {createLogger, format, transports} = require('winston') -class Logger extends winston.Logger { - // Implement stream.writable.write interface - write (chunk) { - this.info(chunk) - } -} - -module.exports = new Logger({ +module.exports = createLogger({ + level: 'debug', + format: format.combine( + format.uncolorize(), + format.timestamp(), + format.align(), + format.splat(), + format.printf(info => `${info.timestamp} ${info.level}: ${info.message}`) + ), transports: [ - new winston.transports.Console({ - level: 'debug', - handleExceptions: true, - json: false, - colorize: false, - timestamp: true + new transports.Console({ + handleExceptions: true }) ], - emitErrs: true, exitOnError: false }) |