From c782b256c0751a8bb40fc309ee75334420890905 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Sun, 22 Nov 2015 07:59:34 +0100 Subject: [PATCH] added getStatus function --- index.js | 3 +++ test.js | 2 ++ ts/index.ts | 3 +++ ts/test.ts | 3 ++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index c16a0db..c5f3d7d 100644 --- a/index.js +++ b/index.js @@ -10,6 +10,9 @@ var smartDebug = { }, activate: function (debugArg) { debugActive = debugArg; + }, + getStatus: function () { + return debugActive; } }; module.exports = smartDebug; diff --git a/test.js b/test.js index 7bdea54..0198d2f 100644 --- a/test.js +++ b/test.js @@ -2,6 +2,8 @@ var smartDebug = require("./index.js"); var bl = require("beautylog")("os"); smartDebug.log("This message is not shown"); +bl.log("debug.status() is " + smartDebug.getStatus()); smartDebug.activate(true); smartDebug.log("This debug message is shown"); +bl.log("debug.status() is " + smartDebug.getStatus()); bl.success("Test successfull"); diff --git a/ts/index.ts b/ts/index.ts index 7c6a728..eb247ce 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -11,6 +11,9 @@ var smartDebug = { }, activate: function(debugArg:boolean){ debugActive = debugArg; + }, + getStatus: function(){ + return debugActive; } }; diff --git a/ts/test.ts b/ts/test.ts index 35a078f..01c95c3 100644 --- a/ts/test.ts +++ b/ts/test.ts @@ -3,7 +3,8 @@ var smartDebug = require("./index.js"); var bl = require("beautylog")("os"); smartDebug.log("This message is not shown"); +bl.log("debug.status() is " + smartDebug.getStatus() ); smartDebug.activate(true); smartDebug.log("This debug message is shown"); - +bl.log("debug.status() is " + smartDebug.getStatus() ); bl.success("Test successfull"); \ No newline at end of file