4 Commits

Author SHA1 Message Date
5f0a7ceaa3 2.0.7 2017-09-19 17:59:01 +02:00
b65a94b86c update 2017-09-19 17:58:59 +02:00
0248a23e7d 2.0.6 2017-09-19 17:48:58 +02:00
068c19704b use console.log as default 2017-09-19 17:48:56 +02:00
4 changed files with 7 additions and 17 deletions

3
dist/index.d.ts vendored
View File

@@ -1,10 +1,9 @@
export declare class SmartDebug { export declare class SmartDebug {
debugLogFunction: any;
private debugEnabled; private debugEnabled;
/** /**
* enables debugging output * enables debugging output
*/ */
enableDebugging(debugLogFunction?: any): void; enableDebugging(): void;
/** /**
* logs a message based on the contraints of the SmartDebug instance * logs a message based on the contraints of the SmartDebug instance
*/ */

11
dist/index.js vendored
View File

@@ -2,27 +2,22 @@
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
class SmartDebug { class SmartDebug {
constructor() { constructor() {
this.debugLogFunction = null;
this.debugEnabled = false; this.debugEnabled = false;
} }
/** /**
* enables debugging output * enables debugging output
*/ */
enableDebugging(debugLogFunction = null) { enableDebugging() {
this.debugEnabled = true; this.debugEnabled = true;
this.debugLogFunction = debugLogFunction;
} }
/** /**
* logs a message based on the contraints of the SmartDebug instance * logs a message based on the contraints of the SmartDebug instance
*/ */
log(logObject) { log(logObject) {
if (this.debugEnabled && this.debugLogFunction) { if (this.debugEnabled) {
this.debugLogFunction(logObject);
}
else if (this.debugEnabled) {
console.log(logObject); console.log(logObject);
} }
} }
} }
exports.SmartDebug = SmartDebug; exports.SmartDebug = SmartDebug;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBO0lBQUE7UUFDRSxxQkFBZ0IsR0FBUSxJQUFJLENBQUE7UUFDcEIsaUJBQVksR0FBWSxLQUFLLENBQUE7SUFx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QUFBO1FBQ3hCLENBQUM7SUFDSCxDQUFDO0NBRUY7QUFuQkQsZ0NBbUJDIn0=

View File

@@ -1,6 +1,6 @@
{ {
"name": "smartdebug", "name": "smartdebug",
"version": "2.0.5", "version": "2.0.7",
"description": "debug the smart way", "description": "debug the smart way",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",

View File

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