flatiron/winston — Issue #96: Documentation: Do we really need to call winston.handleExceptions(); if instantiating winston.
Author: SeanBannister
Created: 2012-02-09 19:12:00+00:00
State: open

I noticed in the documentation (README.md) it mentions :

//
// Alternatively you can set `.handleExceptions` to true when adding transports to winston
//
winston.add(winston.transports.File, {
filename: 'path/to/all-logs.log',
handleExceptions: true
});

winston.handleExceptions();

From my tests (sorry I haven't dug into the code) I noticed winston.handleExceptions() isn't required when instantiating winston like so:

var debug = new (winston.Logger)({
transports: [
new (winston.transports.Console)({
handleExceptions: true
})
],
// When an uncaught exception error is recieved don't kill node.js
exitOnError: false
});

I was just wondering if this should be made a little clearer in the documentation. As I almost included winston.handleExceptions(); in my code.