adding a debug library
[nodejs-repoproxy.git] / lib / debug.js
diff --git a/lib/debug.js b/lib/debug.js
new file mode 100644 (file)
index 0000000..5a6cc8a
--- /dev/null
@@ -0,0 +1,17 @@
+var log = require("./log.js");
+
+function startDebugTimer() {
+       if(typeof global.repoproxy != "undefined") {
+               if(global.repoproxy.loglevel >= 5) {
+                       log.debug("starting debug timer on loglevel");
+                       setInterval(debugTimer, 1500);
+               }
+       }
+}
+
+function debugTimer() {
+       log.debug("globals: ", global.repoproxy);
+       log.debug("*****TICK******");
+}
+
+exports.startDebugTimer = startDebugTimer;
\ No newline at end of file