2018-04-12 16:02:48 +00:00
|
|
|
import * as plugins from './smartdebug.plugins';
|
2015-11-15 19:35:13 +00:00
|
|
|
|
2017-09-18 13:19:18 +00:00
|
|
|
export class SmartDebug {
|
2018-04-12 16:02:48 +00:00
|
|
|
private _debugEnabled: boolean = false;
|
|
|
|
get debugEnabled () {
|
|
|
|
return this._debugEnabled;
|
|
|
|
}
|
2017-09-18 13:19:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* enables debugging output
|
|
|
|
*/
|
2018-04-12 16:02:48 +00:00
|
|
|
public enableDebugging() {
|
|
|
|
this._debugEnabled = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* disables debugging
|
|
|
|
*/
|
|
|
|
public disableDebugging() {
|
|
|
|
this._debugEnabled = false;
|
2017-09-18 13:19:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* logs a message based on the contraints of the SmartDebug instance
|
|
|
|
*/
|
2018-04-12 16:02:48 +00:00
|
|
|
public log(logObject: any) {
|
|
|
|
if (this._debugEnabled) {
|
|
|
|
// tslint:disable-next-line:no-console
|
|
|
|
console.log(logObject);
|
2015-11-15 19:35:13 +00:00
|
|
|
}
|
2017-09-18 13:19:18 +00:00
|
|
|
}
|
2015-11-15 19:35:13 +00:00
|
|
|
|
2018-04-12 16:02:48 +00:00
|
|
|
/**
|
|
|
|
* a function returning
|
|
|
|
*/
|
|
|
|
public isDebugMode() {
|
|
|
|
return this._debugEnabled;
|
|
|
|
}
|
2017-09-18 13:19:18 +00:00
|
|
|
}
|