mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-12 22:26:08 -04:00
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:
parent
54d3d930cf
commit
c3584770f2
7 changed files with 25 additions and 17 deletions
|
@ -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
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue