better debug output
This commit is contained in:
parent
d9679f79e2
commit
c31265d4bd
8
index.js
8
index.js
@ -1,15 +1,15 @@
|
|||||||
/// <reference path="typings/tsd.d.ts" />
|
/// <reference path="typings/tsd.d.ts" />
|
||||||
var beautylog = require("beautylog");
|
var beautylog = require("beautylog")("os");
|
||||||
var colors = require("colors");
|
var colors = require("colors");
|
||||||
var debugActive = false;
|
var debugActive = false;
|
||||||
var smartdebug = {
|
var smartDebug = {
|
||||||
log: function (message) {
|
log: function (message) {
|
||||||
if (debugActive) {
|
if (debugActive) {
|
||||||
beautylog.log("Debug:".zebra + ' ' + message);
|
beautylog.log("###DEBUG:###".rainbow + ' ' + message);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
activate: function (debugArg) {
|
activate: function (debugArg) {
|
||||||
debugActive = debugArg;
|
debugActive = debugArg;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
module.exports = smartdebug;
|
module.exports = smartDebug;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"description": "debug your JavaScript the smart way",
|
"description": "debug your JavaScript the smart way",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(cd ts/compile && node compile.js)",
|
"test": "(cd ts/compile && node compile.js) && (node test.js)",
|
||||||
"reinstall": "(rm -r node_modules && npm install)",
|
"reinstall": "(rm -r node_modules && npm install)",
|
||||||
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)",
|
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)",
|
||||||
"startdev": "(git checkout master && git pull origin master)"
|
"startdev": "(git checkout master && git pull origin master)"
|
||||||
|
5
test.js
5
test.js
@ -1 +1,4 @@
|
|||||||
|
var smartDebug = require("./index.js");
|
||||||
|
smartDebug.log("test");
|
||||||
|
smartDebug.activate(true);
|
||||||
|
smartDebug.log("test2");
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/// <reference path="typings/tsd.d.ts" />
|
/// <reference path="typings/tsd.d.ts" />
|
||||||
var beautylog = require("beautylog");
|
var beautylog = require("beautylog")("os");
|
||||||
var colors = require("colors");
|
var colors = require("colors");
|
||||||
|
|
||||||
var debugActive:boolean = false;
|
var debugActive:boolean = false;
|
||||||
var smartdebug = {
|
var smartDebug = {
|
||||||
log: function(message:string){
|
log: function(message:string){
|
||||||
if (debugActive) {
|
if (debugActive) {
|
||||||
beautylog.log("Debug:".zebra + ' ' + message);
|
beautylog.log("###DEBUG:###".rainbow + ' ' + message);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
activate: function(debugArg:boolean){
|
activate: function(debugArg:boolean){
|
||||||
@ -14,4 +14,4 @@ var smartdebug = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = smartdebug;
|
module.exports = smartDebug;
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
var smartDebug = require("./index.js");
|
||||||
|
|
||||||
|
smartDebug.log("test");
|
||||||
|
smartDebug.activate(true);
|
||||||
|
smartDebug.log("test2");
|
Loading…
Reference in New Issue
Block a user