From 2206c397408ddaaadcbbb07ad42626ecaa937435 Mon Sep 17 00:00:00 2001 From: wbt Date: Thu, 9 Dec 2021 19:24:17 -0500 Subject: [PATCH] Unhandle exceptions and rejections B4 replacement Attempts to address [comment](https://github.com/winstonjs/winston/pull/1824#issuecomment-784935345) by @unconfident --- lib/winston/logger.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/winston/logger.js b/lib/winston/logger.js index dc7866854..21b484d57 100644 --- a/lib/winston/logger.js +++ b/lib/winston/logger.js @@ -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 = {};