fixed to work with node 0.5.x
This commit is contained in:
@@ -249,22 +249,15 @@ function getDefaultLogger () {
|
||||
}
|
||||
|
||||
function findConfiguration() {
|
||||
//add current directory onto the list of configPaths
|
||||
var paths = ['.'].concat(require.paths);
|
||||
//add this module's directory to the end of the list, so that we pick up the default config
|
||||
paths.push(__dirname);
|
||||
var pathsWithConfig = paths.filter( function (pathToCheck) {
|
||||
try {
|
||||
fs.statSync(path.join(pathToCheck, "log4js.json"));
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (pathsWithConfig.length > 0) {
|
||||
return path.join(pathsWithConfig[0], 'log4js.json');
|
||||
var path;
|
||||
try {
|
||||
path = require.resolve('log4js.json');
|
||||
} catch (e) {
|
||||
//file not found. default to the one in the log4js module.
|
||||
path = __dirname + '/log4js.json';
|
||||
}
|
||||
return undefined;
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
function loadConfigurationFile(filename) {
|
||||
|
||||
Reference in New Issue
Block a user