diff --git a/modules/logging.js b/modules/logging.js index 66f1f2f..d951073 100644 --- a/modules/logging.js +++ b/modules/logging.js @@ -2,15 +2,19 @@ var config = require("./config"); var exp = {}; -function debug() { - if (config.debug_enabled) { - console.log(Array.prototype.slice.call(arguments).join(" ")); - } +function log() { + var time = new Date().toISOString(); + var text = Array.prototype.slice.call(arguments).join(" "); + console.log(time + ": " + text); } -exp.log = console.log; -exp.warn = console.warn; -exp.error = console.error; -exp.debug = debug; +exp.log = log; +exp.warn = log; +exp.error = log; +if (config.debug_enabled) { + exp.debug = log; +} else { + exp.debug = function(){}; +} module.exports = exp; \ No newline at end of file