smartdebug/ts/index.ts
Philipp Kunz 79f97b504b small fix
2015-11-28 22:48:41 +01:00

26 lines
596 B
TypeScript

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