fixed connect-logger

This commit is contained in:
Gareth Jones
2011-07-19 09:08:15 +10:00
parent 800f0d6bf6
commit 0968c6709f
3 changed files with 11 additions and 8 deletions

View File

@@ -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