Skip to content

Commit

Permalink
Cleanup exception/rejection handler B4 replacing.
Browse files Browse the repository at this point in the history
Attempts to address comment: winstonjs#1824 (comment)
  • Loading branch information
wbt authored Feb 24, 2021
1 parent 2625f60 commit 1c05014
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(this.exceptions !== undefined) {
this.exceptions.unhandle();
}
if(this.rejections !== undefined) {
this.rejections.unhandle();
}
this.exceptions = new ExceptionHandler(this);
this.rejections = new RejectionHandler(this);
this.profilers = {};
Expand Down

0 comments on commit 1c05014

Please sign in to comment.