fixed the nolog tests
This commit is contained in:
@@ -45,8 +45,8 @@ function getLogger(logger4js, options) {
|
||||
// mount safety
|
||||
if (req._logging) return next();
|
||||
|
||||
// nologs
|
||||
if(nolog && nolog.test(req.originalUrl)) return next();
|
||||
// nologs
|
||||
if (nolog && nolog.test(req.originalUrl)) return next();
|
||||
|
||||
if (thislogger.isLevelEnabled(level)) {
|
||||
|
||||
@@ -80,7 +80,7 @@ function getLogger(logger4js, options) {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
//ensure next gets always called
|
||||
next();
|
||||
};
|
||||
@@ -165,4 +165,4 @@ function createNoLogCondition(nolog, type) {
|
||||
}
|
||||
}
|
||||
|
||||
exports.connectLogger = getLogger;
|
||||
exports.connectLogger = getLogger;
|
||||
|
||||
@@ -12,18 +12,17 @@ function Level(level, levelStr) {
|
||||
*/
|
||||
function toLevel(sArg, defaultLevel) {
|
||||
|
||||
if (sArg === null) {
|
||||
return defaultLevel;
|
||||
if (!sArg) {
|
||||
return defaultLevel;
|
||||
}
|
||||
|
||||
if (typeof sArg == "string") {
|
||||
var s = sArg.toUpperCase();
|
||||
if (module.exports[s]) {
|
||||
return module.exports[s];
|
||||
}
|
||||
else {
|
||||
return defaultLevel;
|
||||
}
|
||||
var s = sArg.toUpperCase();
|
||||
if (module.exports[s]) {
|
||||
return module.exports[s];
|
||||
} else {
|
||||
return defaultLevel;
|
||||
}
|
||||
}
|
||||
|
||||
return toLevel(sArg.toString());
|
||||
|
||||
Reference in New Issue
Block a user