reduced complex function to smaller ones
This commit is contained in:
parent
0a2a6c0769
commit
94dbd22c71
@ -111,21 +111,29 @@ function addAppender () {
|
||||
}
|
||||
|
||||
args.forEach(function(category) {
|
||||
if (!appenders[category]) {
|
||||
appenders[category] = [];
|
||||
}
|
||||
appenders[category].push(appender);
|
||||
addAppenderToCategory(appender, category);
|
||||
|
||||
if (category === ALL_CATEGORIES) {
|
||||
addAppenderToAllLoggers(appender);
|
||||
} else if (loggers[category]) {
|
||||
loggers[category].addListener("log", appender);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addAppenderToAllLoggers(appender) {
|
||||
for (var logger in loggers) {
|
||||
if (loggers.hasOwnProperty(logger)) {
|
||||
loggers[logger].addListener("log", appender);
|
||||
}
|
||||
}
|
||||
} else if (loggers[category]) {
|
||||
loggers[category].addListener("log", appender);
|
||||
}
|
||||
});
|
||||
|
||||
function addAppenderToCategory(appender, category) {
|
||||
if (!appenders[category]) {
|
||||
appenders[category] = [];
|
||||
}
|
||||
appenders[category].push(appender);
|
||||
}
|
||||
|
||||
function clearAppenders () {
|
||||
|
Loading…
Reference in New Issue
Block a user