Permalink
Browse files

Merge branch 'master' of github.com:st3v/winston into st3v-master

  • Loading branch information...
2 parents f0d97cc + 5766847 commit 0e30809e0daa66ee1e60ff2f180751e667d84968 @jfhbrook jfhbrook committed Oct 19, 2012
Showing with 17 additions and 0 deletions.
  1. +1 −0 lib/winston/logger.js
  2. +16 −0 test/logger-test.js
View
1 lib/winston/logger.js 100644 → 100755
@@ -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();
}
View
16 test/logger-test.js 100644 → 100755
@@ -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.