Skip to content

Commit

Permalink
Unhandle exceptions and rejections B4 replacement
Browse files Browse the repository at this point in the history
Attempts to address [comment](winstonjs#1824 (comment)) by @unconfident
  • Loading branch information
wbt committed Dec 10, 2021
1 parent 2625f60 commit da9c076
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/winston/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ class Logger extends Transform {
// Hoist other options onto this instance.
this.levels = levels || this.levels || config.npm.levels;
this.level = level;
if(typeof logger.exceptions !== 'undefined') {
logger.exceptions.unhandle();
}
if(typeof logger.rejections !== 'undefined') {
logger.rejections.unhandle();
}
this.exceptions = new ExceptionHandler(this);
this.rejections = new RejectionHandler(this);
this.profilers = {};
Expand Down

0 comments on commit da9c076

Please sign in to comment.