From ff5f3417d371f60a103cebb748a883374cbb4ed0 Mon Sep 17 00:00:00 2001 From: Yoni Jah Date: Thu, 15 Oct 2015 15:06:17 +0800 Subject: [PATCH] fix for winston.config.syslog.levels which are not in the right priority order for winston --- lib/winston-syslog.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/winston-syslog.js b/lib/winston-syslog.js index eb5884e..8599b03 100644 --- a/lib/winston-syslog.js +++ b/lib/winston-syslog.js @@ -13,18 +13,19 @@ var dgram = require('dgram'), glossy = require('glossy'), winston = require('winston'), unix = require('unix-dgram'), - common = require('winston/lib/winston/common'); - -var levels = Object.keys({ - debug: 0, - info: 1, - notice: 2, - warning: 3, - error: 4, - crit: 5, - alert: 6, - emerg: 7 -}); + common = require('winston/lib/winston/common'), + syslogLevels = { + debug: 0, + info: 1, + notice: 2, + warning: 3, + error: 4, + crit: 5, + alert: 6, + emerg: 7 + }; + +var levels = Object.keys(syslogLevels); // // ### function Syslog (options) @@ -105,6 +106,7 @@ util.inherits(Syslog, winston.Transport); // is available and thus backwards compatible. // winston.transports.Syslog = Syslog; +winston.config.syslog.levels = syslogLevels; // // Expose the name of this Transport on the prototype