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