This commit is contained in:
2017-09-19 17:58:59 +02:00
parent 0248a23e7d
commit b65a94b86c
3 changed files with 6 additions and 19 deletions

View File

@ -1,24 +1,20 @@
import * as plugins from './smartdebug.plugins'
export class SmartDebug {
debugLogFunction: any = null
private debugEnabled: boolean = false
/**
* enables debugging output
*/
enableDebugging (debugLogFunction = console.log) {
enableDebugging () {
this.debugEnabled = true
this.debugLogFunction = debugLogFunction
}
/**
* logs a message based on the contraints of the SmartDebug instance
*/
log (logObject: any) {
if (this.debugEnabled && this.debugLogFunction) {
this.debugLogFunction(logObject)
} else if (this.debugEnabled) {
if (this.debugEnabled) {
console.log(logObject)
}
}