fixed the nolog tests
This commit is contained in:
parent
613a077a61
commit
61078e88ef
@ -46,7 +46,7 @@ function getLogger(logger4js, options) {
|
|||||||
if (req._logging) return next();
|
if (req._logging) return next();
|
||||||
|
|
||||||
// nologs
|
// nologs
|
||||||
if(nolog && nolog.test(req.originalUrl)) return next();
|
if (nolog && nolog.test(req.originalUrl)) return next();
|
||||||
|
|
||||||
if (thislogger.isLevelEnabled(level)) {
|
if (thislogger.isLevelEnabled(level)) {
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ function Level(level, levelStr) {
|
|||||||
*/
|
*/
|
||||||
function toLevel(sArg, defaultLevel) {
|
function toLevel(sArg, defaultLevel) {
|
||||||
|
|
||||||
if (sArg === null) {
|
if (!sArg) {
|
||||||
return defaultLevel;
|
return defaultLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,8 +20,7 @@ function toLevel(sArg, defaultLevel) {
|
|||||||
var s = sArg.toUpperCase();
|
var s = sArg.toUpperCase();
|
||||||
if (module.exports[s]) {
|
if (module.exports[s]) {
|
||||||
return module.exports[s];
|
return module.exports[s];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return defaultLevel;
|
return defaultLevel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ vows.describe('log4js connect logger').addBatch({
|
|||||||
'nolog String' : {
|
'nolog String' : {
|
||||||
topic: function(clm) {
|
topic: function(clm) {
|
||||||
var ml = new MockLogger();
|
var ml = new MockLogger();
|
||||||
var cl = clm.connectLogger(ml, {nolog: "\\.gif"});
|
var cl = clm.connectLogger(ml, { nolog: "\\.gif" });
|
||||||
return {cl: cl, ml: ml};
|
return {cl: cl, ml: ml};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user