smartdebug/index.js

16 lines
409 B
JavaScript
Raw Normal View History

2015-11-15 19:35:13 +00:00
/// <reference path="typings/tsd.d.ts" />
2015-11-16 00:50:28 +00:00
var beautylog = require("beautylog")("os");
2015-11-15 19:35:13 +00:00
var colors = require("colors");
var debugActive = false;
2015-11-16 00:50:28 +00:00
var smartDebug = {
2015-11-15 19:35:13 +00:00
log: function (message) {
if (debugActive) {
2015-11-16 00:50:28 +00:00
beautylog.log("###DEBUG:###".rainbow + ' ' + message);
2015-11-15 19:35:13 +00:00
}
},
activate: function (debugArg) {
debugActive = debugArg;
}
};
2015-11-16 00:50:28 +00:00
module.exports = smartDebug;