Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 0e30809e0daa66ee1e60ff2f180751e667d84968 2 parents f0d97cc + 5766847
@jfhbrook jfhbrook authored
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);
Please sign in to comment.
Something went wrong with that request. Please try again.