Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[api] Use `options.name` when creating a new transport

Winston uses `transport.name` to distinguish transports and don't allow
duplicates to be created. It's convenient to be able to set this
property from `options` object when creating an instance of a transport.
  • Loading branch information...
commit 1456706c7c4d855575e7d194786eed7eed1d9d39 1 parent 16dc3a9
@mmalecki mmalecki authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/winston/transports/transport.js
View
3  lib/winston/transports/transport.js
@@ -22,6 +22,7 @@ var Transport = exports.Transport = function (options) {
this.level = options.level || 'info';
this.silent = options.silent || false;
this.raw = options.raw || false;
+ this.name = options.name;
this.handleExceptions = options.handleExceptions || false;
};
@@ -56,4 +57,4 @@ Transport.prototype.logException = function (msg, meta, callback) {
this.once('logged', onLogged);
this.once('error', onError);
this.log('error', msg, meta, function () { });
-};
+};
Please sign in to comment.
Something went wrong with that request. Please try again.