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(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(global.repoproxy.loglevel >= 4) {
35 sendLog.apply(this, arguments);
40 var orig = arguments["0"];
41 var ts = new Date().toISOString();
42 //var ts = ts_t.format("%Y-%m-%d %H:%M:%S");
43 arguments["0"] = "[!!WARNING!!] ("+ts+"): "+orig;
45 if(global.repoproxy.loglevel >= 2) {
46 sendLog.apply(this, arguments);
51 var orig = arguments["0"];
52 var ts = new Date().toISOString();
53 //var ts = ts_t.format("%Y-%m-%d %H:%M:%S");
54 arguments["0"] = "[**ERROR**] ("+ts+"): "+orig;
56 if(global.repoproxy.loglevel >= 1) {
57 sendLog.apply(this, arguments);
62 console.log.apply(this, arguments);
67 exports.debug = debug;
68 exports.warning = warning;
69 exports.error = error;
70 exports.testLogSettings = testLogSettings;