added getStatus function

This commit is contained in:
Philipp Kunz 2015-11-22 07:59:34 +01:00
parent f78b0b6fb8
commit c782b256c0
4 changed files with 10 additions and 1 deletions

View File

@ -10,6 +10,9 @@ var smartDebug = {
},
activate: function (debugArg) {
debugActive = debugArg;
},
getStatus: function () {
return debugActive;
}
};
module.exports = smartDebug;

View File

@ -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");

View File

@ -11,6 +11,9 @@ var smartDebug = {
},
activate: function(debugArg:boolean){
debugActive = debugArg;
},
getStatus: function(){
return debugActive;
}
};

View File

@ -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");