smartdebug/index.js
2015-11-16 01:50:28 +01:00

16 lines
409 B
JavaScript

/// <reference path="typings/tsd.d.ts" />
var beautylog = require("beautylog")("os");
var colors = require("colors");
var debugActive = false;
var smartDebug = {
log: function (message) {
if (debugActive) {
beautylog.log("###DEBUG:###".rainbow + ' ' + message);
}
},
activate: function (debugArg) {
debugActive = debugArg;
}
};
module.exports = smartDebug;