diff --git a/lib/logger.js b/lib/logger.js index 4da0daf..1c6ff50 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -49,9 +49,12 @@ Logger.prototype.removeLevel = function() { 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); + , logLevel = levels.toLevel(args.shift()) + , loggingEvent; + if (this.isLevelEnabled(logLevel)) { + loggingEvent = new LoggingEvent(this.category, logLevel, args, this); + this.emit("log", loggingEvent); + } }; Logger.prototype.isLevelEnabled = function(otherLevel) {