mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-22 07:51:17 +01:00
add timestamp to logs
This commit is contained in:
parent
e3f4d8d743
commit
7e0e66177d
@ -2,15 +2,19 @@ var config = require("./config");
|
|||||||
|
|
||||||
var exp = {};
|
var exp = {};
|
||||||
|
|
||||||
function debug() {
|
function log() {
|
||||||
if (config.debug_enabled) {
|
var time = new Date().toISOString();
|
||||||
console.log(Array.prototype.slice.call(arguments).join(" "));
|
var text = Array.prototype.slice.call(arguments).join(" ");
|
||||||
}
|
console.log(time + ": " + text);
|
||||||
}
|
}
|
||||||
|
|
||||||
exp.log = console.log;
|
exp.log = log;
|
||||||
exp.warn = console.warn;
|
exp.warn = log;
|
||||||
exp.error = console.error;
|
exp.error = log;
|
||||||
exp.debug = debug;
|
if (config.debug_enabled) {
|
||||||
|
exp.debug = log;
|
||||||
|
} else {
|
||||||
|
exp.debug = function(){};
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = exp;
|
module.exports = exp;
|
||||||
Loading…
x
Reference in New Issue
Block a user