added getStatus function
This commit is contained in:
parent
f78b0b6fb8
commit
c782b256c0
3
index.js
3
index.js
@ -10,6 +10,9 @@ var smartDebug = {
|
|||||||
},
|
},
|
||||||
activate: function (debugArg) {
|
activate: function (debugArg) {
|
||||||
debugActive = debugArg;
|
debugActive = debugArg;
|
||||||
|
},
|
||||||
|
getStatus: function () {
|
||||||
|
return debugActive;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
module.exports = smartDebug;
|
module.exports = smartDebug;
|
||||||
|
2
test.js
2
test.js
@ -2,6 +2,8 @@
|
|||||||
var smartDebug = require("./index.js");
|
var smartDebug = require("./index.js");
|
||||||
var bl = require("beautylog")("os");
|
var bl = require("beautylog")("os");
|
||||||
smartDebug.log("This message is not shown");
|
smartDebug.log("This message is not shown");
|
||||||
|
bl.log("debug.status() is " + smartDebug.getStatus());
|
||||||
smartDebug.activate(true);
|
smartDebug.activate(true);
|
||||||
smartDebug.log("This debug message is shown");
|
smartDebug.log("This debug message is shown");
|
||||||
|
bl.log("debug.status() is " + smartDebug.getStatus());
|
||||||
bl.success("Test successfull");
|
bl.success("Test successfull");
|
||||||
|
@ -11,6 +11,9 @@ var smartDebug = {
|
|||||||
},
|
},
|
||||||
activate: function(debugArg:boolean){
|
activate: function(debugArg:boolean){
|
||||||
debugActive = debugArg;
|
debugActive = debugArg;
|
||||||
|
},
|
||||||
|
getStatus: function(){
|
||||||
|
return debugActive;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3,7 +3,8 @@ var smartDebug = require("./index.js");
|
|||||||
var bl = require("beautylog")("os");
|
var bl = require("beautylog")("os");
|
||||||
|
|
||||||
smartDebug.log("This message is not shown");
|
smartDebug.log("This message is not shown");
|
||||||
|
bl.log("debug.status() is " + smartDebug.getStatus() );
|
||||||
smartDebug.activate(true);
|
smartDebug.activate(true);
|
||||||
smartDebug.log("This debug message is shown");
|
smartDebug.log("This debug message is shown");
|
||||||
|
bl.log("debug.status() is " + smartDebug.getStatus() );
|
||||||
bl.success("Test successfull");
|
bl.success("Test successfull");
|
Loading…
Reference in New Issue
Block a user