4 * # level for logging (1 = error, 2 = warning, 3=info, 4=debug);
8 function testLogSettings() {
9 var curtime = new Date().getTime();
10 debug("This is a DEBUG TeST (%d)", curtime);
11 info("This is an Info TEST (%d)", curtime);
12 warning("This is a WARN test (%d)", curtime);
13 error("This is an ERROR test (%d)", curtime);
18 var orig = arguments["0"];
19 var ts = new Date().toISOString();
20 //var ts = ts_t.format("%Y-%m-%d %H:%M:%S");
21 arguments["0"] = "[??INFO??] ("+ts+"): "+orig;
23 if(typeof global.repoproxy == "undefined" || global.repoproxy.loglevel >= 3) {
24 sendLog.apply(this, arguments);
29 var orig = arguments["0"];
30 var ts = new Date().toISOString();
31 //var ts = ts_t.format("%Y-%m-%d %H:%M:%S");
32 arguments["0"] = "[^^DEBUG^^] ("+ts+"): "+orig;
34 if(typeof global.repoproxy != "undefined") {
35 if(global.repoproxy.loglevel >= 4) {
36 sendLog.apply(this, arguments);
42 var orig = arguments["0"];
43 var ts = new Date().toISOString();
44 //var ts = ts_t.format("%Y-%m-%d %H:%M:%S");
45 arguments["0"] = "[!!WARNING!!] ("+ts+"): "+orig;
47 if(typeof global.repoproxy == "undefined" || global.repoproxy.loglevel >= 2) {
48 sendLog.apply(this, arguments);
53 var orig = arguments["0"];
54 var ts = new Date().toISOString();
55 //var ts = ts_t.format("%Y-%m-%d %H:%M:%S");
56 arguments["0"] = "[**ERROR**] ("+ts+"): "+orig;
58 if(typeof global.repoproxy == "undefined" || global.repoproxy.loglevel >= 1) {
59 sendLog.apply(this, arguments);
64 console.log.apply(this, arguments);
69 exports.debug = debug;
70 exports.warning = warning;
71 exports.error = error;
72 exports.testLogSettings = testLogSettings;