Added filtering to appender loader - was choking on .svn files

This commit is contained in:
Gareth Jones 2011-08-11 16:27:37 +10:00
parent 8d7b5513fb
commit 53a481d4da
2 changed files with 6 additions and 4 deletions

View File

@ -358,9 +358,11 @@ function replaceConsole(logger) {
function loadAppenders() { function loadAppenders() {
var appenderList = fs.readdirSync(__dirname + '/appenders'); var appenderList = fs.readdirSync(__dirname + '/appenders');
appenderList.forEach(function(file) { appenderList.forEach(function(file) {
var appenderModule = require('./appenders/' + file); if (/\.js$/.test(file)) {
module.exports.appenders[appenderModule.name] = appenderModule.appender; var appenderModule = require('./appenders/' + file);
appenderMakers[appenderModule.name] = appenderModule.configure; module.exports.appenders[appenderModule.name] = appenderModule.appender;
appenderMakers[appenderModule.name] = appenderModule.configure;
}
}); });
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "log4js", "name": "log4js",
"version": "0.3.7", "version": "0.3.8",
"description": "Port of Log4js to work with node.", "description": "Port of Log4js to work with node.",
"keywords": [ "keywords": [
"logging", "logging",