Skip to content

Commit

Permalink
append stacktraces to winston
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycarambat committed Jul 20, 2024
1 parent 89db7a9 commit cec1a3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions collector/utils/logger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
3 changes: 3 additions & 0 deletions server/utils/logger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit cec1a3d

Please sign in to comment.