Prepend date/time to logger messages

This commit is contained in:
Danimal4326
2016-03-03 12:24:54 -06:00
parent 9d7c1de9dd
commit df8508a38f

View File

@@ -65,6 +65,10 @@ Logger.prototype.log = function(level, msg) {
if (this.prefix) if (this.prefix)
msg = chalk.cyan("[" + this.prefix + "]") + " " + msg; msg = chalk.cyan("[" + this.prefix + "]") + " " + msg;
// prepend timestamp
var date = new Date();
msg = chalk.black("[" + date.toLocaleString() + "]") + " " + msg;
func(msg); func(msg);
} }