formatting fixes, unnecessary code removed

This commit is contained in:
Gareth Jones 2013-08-05 11:40:59 +10:00
parent c67ab855bb
commit 8ad1cd67e2
2 changed files with 79 additions and 79 deletions

View File

@ -1,17 +1,13 @@
var levels = require('../levels');
"use strict";
var log4js = require('../log4js');
function contains(list, value) {
return list.indexOf(value) !== -1;
}
function categoryFilter (excludes, appender) {
if (typeof(excludes) === 'string') excludes = [excludes];
return function(logEvent) {
if (excludes.indexOf(logEvent.categoryName) === -1) {
appender(logEvent);
}
}
};
}
function configure(config) {

View File

@ -18,7 +18,11 @@ vows.describe('log4js categoryFilter').addBatch({
var log4js = require('../lib/log4js'), logEvents = [], webLogger, appLogger;
log4js.clearAppenders();
var appender = require('../lib/appenders/categoryFilter').appender(['app'], function(evt) { logEvents.push(evt); });
var appender = require('../lib/appenders/categoryFilter')
.appender(
['app'],
function(evt) { logEvents.push(evt); }
);
log4js.addAppender(appender, ["app","web"]);
webLogger = log4js.getLogger("web");