mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-25 05:52:18 +00:00
036b2414f3
Use class style implement write interface
23 lines
433 B
JavaScript
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
|
|
})
|