This commit is contained in:
Gareth Jones 2014-03-05 09:24:09 +11:00
commit c09c11b147
2 changed files with 7 additions and 4 deletions

View File

@ -49,9 +49,12 @@ Logger.prototype.removeLevel = function() {
Logger.prototype.log = function() { Logger.prototype.log = function() {
var args = Array.prototype.slice.call(arguments) var args = Array.prototype.slice.call(arguments)
, logLevel = args.shift() , logLevel = levels.toLevel(args.shift())
, loggingEvent = new LoggingEvent(this.category, logLevel, args, this); , loggingEvent;
if (this.isLevelEnabled(logLevel)) {
loggingEvent = new LoggingEvent(this.category, logLevel, args, this);
this.emit("log", loggingEvent); this.emit("log", loggingEvent);
}
}; };
Logger.prototype.isLevelEnabled = function(otherLevel) { Logger.prototype.isLevelEnabled = function(otherLevel) {

View File

@ -70,7 +70,7 @@ vows.describe('log4js logglyAppender').addBatch({
tags: ['loggly-tag1', 'loggly-tag2', 'loggly-tagn'] tags: ['loggly-tag1', 'loggly-tag2', 'loggly-tagn']
}); });
setup.logger.log('Log event #1'); setup.logger.log('trace', 'Log event #1');
return setup; return setup;
}, },
'there should be one message only': function (topic) { 'there should be one message only': function (topic) {