fixed connect-logger
This commit is contained in:
@@ -217,9 +217,10 @@ Logger.prototype.removeLevel = function() {
|
||||
delete this.level;
|
||||
};
|
||||
|
||||
Logger.prototype.log = function(logLevel, args) {
|
||||
var data = Array.prototype.slice.call(args)
|
||||
, loggingEvent = new LoggingEvent(this.category, logLevel, data, this);
|
||||
Logger.prototype.log = function() {
|
||||
var args = Array.prototype.slice.call(arguments)
|
||||
, logLevel = args.shift()
|
||||
, loggingEvent = new LoggingEvent(this.category, logLevel, args, this);
|
||||
this.emit("log", loggingEvent);
|
||||
};
|
||||
|
||||
@@ -236,7 +237,9 @@ Logger.prototype.isLevelEnabled = function(otherLevel) {
|
||||
|
||||
Logger.prototype[levelString.toLowerCase()] = function () {
|
||||
if (this.isLevelEnabled(level)) {
|
||||
this.log(level, arguments);
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
args.unshift(level);
|
||||
Logger.prototype.log.apply(this, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -411,7 +414,7 @@ module.exports = {
|
||||
logLevelFilter: logLevelFilter,
|
||||
|
||||
layouts: layouts,
|
||||
connectLogger: require('./connect-logger').connectLogger(this)
|
||||
connectLogger: require('./connect-logger').connectLogger
|
||||
};
|
||||
|
||||
//keep the old-style layouts
|
||||
|
||||
Reference in New Issue
Block a user