This commit is contained in:
2017-09-18 15:19:18 +02:00
parent 1f09d67196
commit c269ac04cd
28 changed files with 579 additions and 2431 deletions

View File

@@ -1,26 +1,22 @@
/// <reference path="typings/tsd.d.ts" />
var beautylog = require("beautylog")("os");
var colors = require("colors");
import * as plugins from './smartdebug.plugins'
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;
beautylog.log("#### ".rainbow + "!!! ".red + "Debugging has been activated!".blue + " !!!".red + " ####".rainbow);
},
getStatus: function(){
return debugActive;
export class SmartDebug {
private debugEnabled: boolean = false
/**
* enables debugging output
*/
enableDebugging () {
this.debugEnabled = true
}
/**
* logs a message based on the contraints of the SmartDebug instance
*/
log (logObject: any) {
if (this.debugEnabled) {
console.log(logObject)
}
};
}
module.exports = smartDebug;
}