-
Notifications
You must be signed in to change notification settings - Fork 166
Closed
pinojs/pino
#528Description
When using pino.final with pino-pretty following exception is thrown:
only compatible with loggers with pino.destination and pino.extreme targets
We are using pretty-printing on the dev boxes and it took me quite a while that pino.final works fine without pino-pretty. Below you find code to reproduce the issue.
Best,
Alexander
const pino = require('pino')
const logger = pino({
prettyPrint: true
})
const run = async () => {
process.on('SIGTERM', pino.final(logger, (err, finalLogger) => {
finalLogger.info('Graceful shutdown 1')
finalLogger.info('Graceful shutdown 2')
process.exit(0)
}))
await delay(30)
}
const delay = (secs) => {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(), secs * 1000)
})
}
run().catch(err => {
logger.error({ err })
})
Metadata
Metadata
Assignees
Labels
No labels