Skip to content

Commit

Permalink
[core] Fix correct name value on the transport
Browse files Browse the repository at this point in the history
It must be `syslog` and not `Syslog`.
  • Loading branch information
santigimeno committed Dec 22, 2015
1 parent 72ee625 commit 2750b51
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 1 addition & 3 deletions lib/winston-syslog.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ var levels = Object.keys({
var Syslog = exports.Syslog = function (options) {
winston.Transport.call(this, options);
options = options || {};
// Set transport name
this.name = 'syslog';
//
// Setup connection state
//
Expand Down Expand Up @@ -108,7 +106,7 @@ winston.transports.Syslog = Syslog;
//
// Expose the name of this Transport on the prototype
//
Syslog.prototype.name = 'Syslog';
Syslog.prototype.name = 'syslog';
//
// ### function log (level, msg, [meta], callback)
// #### @level {string} Target level to log to
Expand Down
8 changes: 8 additions & 0 deletions test/syslog-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ vows.describe('winston-syslog').addBatch({
assert.equal(transport.localhost, false);
transport.close();
}
},
'adding / removing transport to syslog': {
'should just work': function () {
winston.add(winston.transports.Syslog);
winston.remove(winston.transports.Syslog);
winston.add(winston.transports.Syslog);
winston.remove(winston.transports.Syslog);
}
}
}
}).export(module);

0 comments on commit 2750b51

Please sign in to comment.