Quando winston gestisce le eccezioni non rilevate, stampa una bella informazione dell'eccezione non rilevata. Come posso fare lo stesso su "eccezioni intercettate"?Come registrare le eccezioni "catched"?
if (err) {
// winston. log the catched exception
}
ho controllato la fonte e sembra che ci sia un logException
method, ma non so come avrei potuto usarlo.
var logger = new winston.Logger({
transports: [new winston.transports.Console({handleExceptions: true})]
})
var err = new Error('test error.')
logger.logException(err.message) //no method 'logException'
Forse questo è da una vecchia versione di Winston, ma non v'è tale API. https://github.com/winstonjs/winston – Seth