fixing up log entries
[nodejs-repoproxy.git] / lib / log.js
index 24f31d2..6cb7e21 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(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);         
        }       
 }