@cryptotaxi247 / netdata-1 / commits / c14be7b03

debug and error logs print also the date and time

Costa Tsaousis (ktsaou) committed Jan 15, 2016 at 00:40 UTC c14be7b039087c71464b35ae9ad4ae45a108fe5a
1 file changed +6 -3
plugins.d/sma_webbox.plugin
+6 -3
@@ -44,12 +44,15 @@ var UPDATE_EVERY = NETDATA_UPDATE_EVERY;
44 var EXIT_AFTER_MS = 3600 * 1000;
45
46 function debug(msg) {
47 - if(DEBUG)
48 - console.error(__filename + ': DEBUG: ' + ((typeof(msg) === 'object')?JSON.stringify(msg):msg).toString());
47 + if(DEBUG) {
48 + var now = new Date();
49 + console.error(now.toString() + ': ' + __filename + ': DEBUG: ' + ((typeof(msg) === 'object')?JSON.stringify(msg):msg).toString());
50 + }
51 }
52
53 function error(msg) {
52 - console.error(__filename + ': ERROR: ' + ((typeof(msg) === 'object')?JSON.stringify(msg):msg).toString());
54 + var now = new Date();
55 + console.error(now.toString() + ': ' + __filename + ': ERROR: ' + ((typeof(msg) === 'object')?JSON.stringify(msg):msg).toString());
56 }
57
58 function netdata(msg) {