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" />
|
||||
var beautylog = require("beautylog");
|
||||
var beautylog = require("beautylog")("os");
|
||||
var colors = require("colors");
|
||||
var debugActive = false;
|
||||
var smartdebug = {
|
||||
var smartDebug = {
|
||||
log: function (message) {
|
||||
if (debugActive) {
|
||||
beautylog.log("Debug:".zebra + ' ' + message);
|
||||
beautylog.log("###DEBUG:###".rainbow + ' ' + message);
|
||||
}
|
||||
},
|
||||
activate: function (debugArg) {
|
||||
debugActive = debugArg;
|
||||
}
|
||||
};
|
||||
module.exports = smartdebug;
|
||||
module.exports = smartDebug;
|
||||
|
@ -4,7 +4,7 @@
|
||||
"description": "debug your JavaScript the smart way",
|
||||
"main": "index.js",
|
||||
"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)",
|
||||
"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)"
|
||||
|
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" />
|
||||
var beautylog = require("beautylog");
|
||||
var beautylog = require("beautylog")("os");
|
||||
var colors = require("colors");
|
||||
|
||||
var debugActive:boolean = false;
|
||||
var smartdebug = {
|
||||
var smartDebug = {
|
||||
log: function(message:string){
|
||||
if (debugActive) {
|
||||
beautylog.log("Debug:".zebra + ' ' + message);
|
||||
beautylog.log("###DEBUG:###".rainbow + ' ' + message);
|
||||
}
|
||||
},
|
||||
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