Skip to content

Commit

Permalink
Merge branch 'master' of github.com:st3v/winston into st3v-master
Browse files Browse the repository at this point in the history
  • Loading branch information
jfhbrook committed Oct 19, 2012
2 parents f0d97cc + 5766847 commit 0e30809
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/winston/logger.js 100644 → 100755
Expand Up @@ -406,6 +406,7 @@ Logger.prototype.unhandleExceptions = function () {

if (this.catchExceptions) {
Object.keys(this.exceptionHandlers).forEach(function (name) {
var handler = self.exceptionHandlers[name];
if (handler.close) {
handler.close();
}
Expand Down
16 changes: 16 additions & 0 deletions test/logger-test.js 100644 → 100755
Expand Up @@ -197,4 +197,20 @@ vows.describe('winton/logger').addBatch({
}
}
}
}).addBatch({
"The winston logger": {
topic: new (winston.Logger)({
exceptionHandlers: [
new (winston.transports.Console)(),
new (winston.transports.File)({ filename: path.join(__dirname, 'fixtures', 'logs', 'filelog.log' )})
]
}),
"the unhandleExceptions() method": {
"should remove all transports": function (logger) {
assert.equal(helpers.size(logger.exceptionHandlers), 2);
logger.unhandleExceptions();
assert.equal(helpers.size(logger.exceptionHandlers), 0);
}
}
}
}).export(module);

0 comments on commit 0e30809

Please sign in to comment.