mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
temp fix for #6848
This commit is contained in:
@@ -12,6 +12,22 @@ function setupWinston() {
|
||||
if (!winston.format) {
|
||||
return;
|
||||
}
|
||||
|
||||
// allow winton.error to log error objects properly
|
||||
// https://github.com/NodeBB/NodeBB/issues/6848
|
||||
const winstonError = winston.error;
|
||||
winston.error = function (msg, error) {
|
||||
if (msg instanceof Error) {
|
||||
winstonError(msg);
|
||||
} else if (error instanceof Error) {
|
||||
msg = msg + '\n' + error.stack;
|
||||
winstonError(msg);
|
||||
} else {
|
||||
winstonError.apply(null, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// https://github.com/winstonjs/winston/issues/1338
|
||||
// error objects are not displayed properly
|
||||
const enumerateErrorFormat = winston.format((info) => {
|
||||
|
||||
Reference in New Issue
Block a user