cache maintenance remove routine added - needs a real one
[nodejs-repoproxy.git] / lib / log.js
index 6cb7e21..49e189f 100644 (file)
@@ -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);         
        }       
 }