X-Git-Url: http://git.pjr.cc/?p=nodejs-repoproxy.git;a=blobdiff_plain;f=lib%2Flog.js;fp=lib%2Flog.js;h=6cb7e214bf285c497c49c2aa9c4ef0b7a15d2c40;hp=24f31d23e13bccef69f68818e7958657a22585ae;hb=3933776341028e83d89e0f888fff3e6319230abf;hpb=d7478970127408f056b157f18df74fef7db3f892 diff --git a/lib/log.js b/lib/log.js index 24f31d2..6cb7e21 100644 --- a/lib/log.js +++ b/lib/log.js @@ -20,7 +20,7 @@ function info() { //var ts = ts_t.format("%Y-%m-%d %H:%M:%S"); arguments["0"] = "[??INFO??] ("+ts+"): "+orig; - if(global.repoproxy.loglevel >= 3) { + if(typeof global.repoproxy.loglevel == "undefined" || global.repoproxy.loglevel >= 3) { sendLog.apply(this, arguments); } } @@ -31,8 +31,10 @@ function debug() { //var ts = ts_t.format("%Y-%m-%d %H:%M:%S"); arguments["0"] = "[^^DEBUG^^] ("+ts+"): "+orig; - if(global.repoproxy.loglevel >= 4) { - sendLog.apply(this, arguments); + if(typeof global.repoproxy.loglevel != "undefined") { + if(global.repoproxy.loglevel >= 3) { + sendLog.apply(this, arguments); + } } } @@ -42,7 +44,7 @@ function warning() { //var ts = ts_t.format("%Y-%m-%d %H:%M:%S"); arguments["0"] = "[!!WARNING!!] ("+ts+"): "+orig; - if(global.repoproxy.loglevel >= 2) { + if(typeof global.repoproxy.loglevel == "undefined" || global.repoproxy.loglevel >= 2) { sendLog.apply(this, arguments); } } @@ -53,7 +55,7 @@ function error() { //var ts = ts_t.format("%Y-%m-%d %H:%M:%S"); arguments["0"] = "[**ERROR**] ("+ts+"): "+orig; - if(global.repoproxy.loglevel >= 1) { + if(typeof global.repoproxy.loglevel == "undefined" || global.repoproxy.loglevel >= 1) { sendLog.apply(this, arguments); } }