add new debugger changes from 0.2.7

This commit is contained in:
Todd Treece 2016-11-09 21:33:40 +00:00
parent d6f27c2928
commit e79b08d66e

View file

@ -1,16 +1,17 @@
// this file is part of the v0.2.1 easel local OS X install.
// this file is part of the v0.2.7 easel local OS X install.
// you can find out more about easel and the x-carve at
// inventables.com & easel.inventables.com
var nextId = 0;
exports.logger = function() {
var logger = function(name) {
var that = {};
var id = Date.now();
var prefix = name + " [id=" + id + "] ";
var id = nextId++;
var prefix = " " + name + " [id=" + id + "] ";
var timestamp = function() {
return "[time=" + Date.now() + "] ";
return (new Date()).toISOString();
};
var withColor = function(msg, color) {
@ -26,7 +27,7 @@ exports.logger = function() {
};
var log = function(msg, color) {
console.log(prefix + timestamp() + withColor(msg, color));
console.log(timestamp() + prefix + withColor(msg, color));
};
that.log = log;