formatting fixes, unnecessary code removed
This commit is contained in:
parent
c67ab855bb
commit
8ad1cd67e2
@ -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) {
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user