HackMD/lib/logger.js
BoHong Li 036b2414f3 refactor(logger): Refactor logger.js
Use class style implement write interface
2017-05-08 19:24:37 +08:00

23 lines
433 B
JavaScript

'use strict'
const winston = require('winston')
class Logger extends winston.Logger {
// Implement stream.writable.write interface
write (chunk) {
this.info(chunk)
}
}
module.exports = new Logger({
transports: [
new winston.transports.Console({
level: 'debug',
handleExceptions: true,
json: false,
colorize: false,
timestamp: true
})
],
emitErrs: true,
exitOnError: false
})