Fix the logLevelFilter with lazy loading

This commit is contained in:
Danny Brain 2011-10-27 16:37:11 +11:00
parent 23a2758a6d
commit 89f3659825

View File

@ -1,4 +1,5 @@
var levels = require('../levels'); var levels = require('../levels');
var log4js = require('../log4js');
function logLevelFilter (levelString, appender) { function logLevelFilter (levelString, appender) {
var level = levels.toLevel(levelString); var level = levels.toLevel(levelString);
@ -10,10 +11,11 @@ function logLevelFilter (levelString, appender) {
} }
function configure(config) { function configure(config) {
var appender = config.makers[config.appender.type](config.appender); log4js.loadAppender(config.appender.type);
var appender = log4js.appenderMakers[config.appender.type](config.appender);
return logLevelFilter(config.level, appender); return logLevelFilter(config.level, appender);
} }
exports.name = "logLevelFilter"; exports.name = "logLevelFilter";
exports.appender = logLevelFilter; exports.appender = logLevelFilter;
exports.configure = configure; exports.configure = configure;