Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d58aa38bd | ||
|
|
304f3801bd | ||
|
|
c87172ff1f | ||
|
|
c782b256c0 | ||
|
|
f78b0b6fb8 | ||
|
|
5c8feb571c | ||
|
|
87411ef5a4 | ||
|
|
114fbe6425 |
@@ -1,8 +1,9 @@
|
|||||||
# smartdebug
|
# smartdebug
|
||||||
works with gulp, but does nothing. Use it to bootstrap your own gulp plugin with TypeScript, Travis and npm.
|
debug your JavaScript the smart way
|
||||||
|
|
||||||
### Buildstatus/Dependencies
|
### Buildstatus/Dependencies
|
||||||
[](https://travis-ci.org/pushrocks/smartdebug)
|
[](https://travis-ci.org/pushrocks/smartdebug)
|
||||||
|
[](https://david-dm.org/pushrocks/smartdebug)
|
||||||
[](https://david-dm.org/pushrocks/smartdebug#info=devDependencies)
|
[](https://david-dm.org/pushrocks/smartdebug#info=devDependencies)
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
@@ -16,3 +17,5 @@ smartDebug.activate(true);
|
|||||||
smartDebug.log("This debug message is shown");
|
smartDebug.log("This debug message is shown");
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The above code produces debug messages like this:
|
||||||
|

|
||||||
|
|||||||
8
index.js
8
index.js
@@ -8,8 +8,16 @@ var smartDebug = {
|
|||||||
beautylog.log("###DEBUG:###".rainbow + ' ' + message);
|
beautylog.log("###DEBUG:###".rainbow + ' ' + message);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
run: function (functionArg) {
|
||||||
|
if (debugActive) {
|
||||||
|
functionArg();
|
||||||
|
}
|
||||||
|
},
|
||||||
activate: function (debugArg) {
|
activate: function (debugArg) {
|
||||||
debugActive = debugArg;
|
debugActive = debugArg;
|
||||||
|
},
|
||||||
|
getStatus: function () {
|
||||||
|
return debugActive;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
module.exports = smartDebug;
|
module.exports = smartDebug;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "smartdebug",
|
"name": "smartdebug",
|
||||||
"version": "0.0.4",
|
"version": "0.0.8",
|
||||||
"description": "debug your JavaScript the smart way",
|
"description": "debug your JavaScript the smart way",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
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");
|
||||||
|
|||||||
@@ -9,8 +9,16 @@ var smartDebug = {
|
|||||||
beautylog.log("###DEBUG:###".rainbow + ' ' + message);
|
beautylog.log("###DEBUG:###".rainbow + ' ' + message);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
run: function(functionArg) {
|
||||||
|
if (debugActive) {
|
||||||
|
functionArg();
|
||||||
|
}
|
||||||
|
}
|
||||||
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");
|
||||||
Reference in New Issue
Block a user