append stacktraces to winston

This commit is contained in:
timothycarambat 2024-07-19 18:13:54 -07:00
parent 89db7a9d45
commit cec1a3d585
2 changed files with 6 additions and 0 deletions
collector/utils/logger
server/utils/logger

View file

@ -34,6 +34,9 @@ class Logger {
return logger.info.apply(logger, arguments);
};
console.error = function () {
if (arguments.length > 0 && arguments[0] instanceof Error) {
return logger.error(arguments[0].stack);
}
return logger.error.apply(logger, arguments);
};
console.info = function () {

View file

@ -32,6 +32,9 @@ class Logger {
return logger.info.apply(logger, arguments);
};
console.error = function () {
if (arguments.length > 0 && arguments[0] instanceof Error) {
return logger.error(arguments[0].stack);
}
return logger.error.apply(logger, arguments);
};
console.info = function () {