fixed the nolog tests

This commit is contained in:
Gareth Jones 2012-05-09 16:40:27 +10:00
parent 613a077a61
commit 61078e88ef
3 changed files with 85 additions and 86 deletions

View File

@ -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)) {

View File

@ -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;
} }
} }

View File

@ -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};
}, },