Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f0a7ceaa3 | |||
| b65a94b86c | |||
| 0248a23e7d | |||
| 068c19704b | |||
| a8b760165d | |||
| b65c012779 | |||
| 657f07120c | |||
| 919a23cd09 | |||
| d5a4a0f4ee |
3
dist/index.d.ts
vendored
3
dist/index.d.ts
vendored
@@ -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
11
dist/index.js
vendored
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBO0lBQUE7UUFDRSxxQkFBZ0IsR0FBUSxJQUFJLENBQUE7UUFDcEIsaUJBQVksR0FBWSxLQUFLLENBQUE7SUFxQnZDLENBQUM7SUFuQkM7O09BRUc7SUFDSCxlQUFlLENBQUUsZ0JBQWdCLEdBQUcsSUFBSTtRQUN0QyxJQUFJLENBQUMsWUFBWSxHQUFHLElBQUksQ0FBQTtRQUN4QixJQUFJLENBQUMsZ0JBQWdCLEdBQUcsZ0JBQWdCLENBQUE7SUFDMUMsQ0FBQztJQUVEOztPQUVHO0lBQ0gsR0FBRyxDQUFFLFNBQWM7UUFDakIsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLFlBQVksSUFBSSxJQUFJLENBQUMsZ0JBQWdCLENBQUMsQ0FBQyxDQUFDO1lBQy9DLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxTQUFTLENBQUMsQ0FBQTtRQUNsQyxDQUFDO1FBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxZQUFZLENBQUMsQ0FBQyxDQUFDO1lBQzdCLE9BQU8sQ0FBQyxHQUFHLENBQUMsU0FBUyxDQUFDLENBQUE7UUFDeEIsQ0FBQztJQUNILENBQUM7Q0FFRjtBQXZCRCxnQ0F1QkMifQ==
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBO0lBQUE7UUFDVSxpQkFBWSxHQUFZLEtBQUssQ0FBQTtJQWtCdkMsQ0FBQztJQWhCQzs7T0FFRztJQUNILGVBQWU7UUFDYixJQUFJLENBQUMsWUFBWSxHQUFHLElBQUksQ0FBQTtJQUMxQixDQUFDO0lBRUQ7O09BRUc7SUFDSCxHQUFHLENBQUUsU0FBYztRQUNqQixFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsWUFBWSxDQUFDLENBQUMsQ0FBQztZQUN0QixPQUFPLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxDQUFBO1FBQ3hCLENBQUM7SUFDSCxDQUFDO0NBRUY7QUFuQkQsZ0NBbUJDIn0=
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "smartdebug",
|
"name": "smartdebug",
|
||||||
"version": "2.0.2",
|
"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",
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user