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>
This commit is contained in:
Sheogorath 2018-11-13 23:29:33 +01:00
parent 54d3d930cf
commit c3584770f2
No known key found for this signature in database
GPG key ID: 1F05CC3635CDDFFD
7 changed files with 25 additions and 17 deletions

View file

@ -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
})