MCPcopy
hub / github.com/winstonjs/winston / _addHandler

Method _addHandler

lib/winston/rejection-handler.js:151–158  ·  view source on GitHub ↗

* Helper method to add a transport as an exception handler. * @param {Transport} handler - The transport to add as an exception handler. * @returns {void}

(handler)

Source from the content-addressed store, hash-verified

149 * @returns {void}
150 */
151 _addHandler(handler) {
152 if (!this.handlers.has(handler)) {
153 handler.handleRejections = true;
154 const wrapper = new RejectionStream(handler);
155 this.handlers.set(handler, wrapper);
156 this.logger.pipe(wrapper);
157 }
158 }
159
160 /**
161 * Logs all relevant information around the `err` and exits the current

Callers 1

handleMethod · 0.95

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected