Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a3aa040e4 | ||
|
|
79f97b504b | ||
|
|
1d58aa38bd | ||
|
|
304f3801bd | ||
|
|
c87172ff1f | ||
|
|
c782b256c0 |
8
index.js
8
index.js
@@ -8,8 +8,16 @@ var smartDebug = {
|
||||
beautylog.log("###DEBUG:###".rainbow + ' ' + message);
|
||||
}
|
||||
},
|
||||
run: function (functionArg) {
|
||||
if (debugActive) {
|
||||
functionArg();
|
||||
}
|
||||
},
|
||||
activate: function (debugArg) {
|
||||
debugActive = debugArg;
|
||||
},
|
||||
getStatus: function () {
|
||||
return debugActive;
|
||||
}
|
||||
};
|
||||
module.exports = smartDebug;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "smartdebug",
|
||||
"version": "0.0.6",
|
||||
"version": "0.0.9",
|
||||
"description": "debug your JavaScript the smart way",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
2
test.js
2
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");
|
||||
|
||||
@@ -9,8 +9,16 @@ var smartDebug = {
|
||||
beautylog.log("###DEBUG:###".rainbow + ' ' + message);
|
||||
}
|
||||
},
|
||||
run: function(functionArg) {
|
||||
if (debugActive) {
|
||||
functionArg();
|
||||
}
|
||||
},
|
||||
activate: function(debugArg:boolean){
|
||||
debugActive = debugArg;
|
||||
},
|
||||
getStatus: function(){
|
||||
return debugActive;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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");
|
||||
Reference in New Issue
Block a user