diff --git a/index.js b/index.js index 4751204..c16a0db 100644 --- a/index.js +++ b/index.js @@ -1,15 +1,15 @@ /// -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; diff --git a/package.json b/package.json index f90e6eb..690f3ab 100644 --- a/package.json +++ b/package.json @@ -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)" diff --git a/test.js b/test.js index 8b13789..3f6fd6e 100644 --- a/test.js +++ b/test.js @@ -1 +1,4 @@ - +var smartDebug = require("./index.js"); +smartDebug.log("test"); +smartDebug.activate(true); +smartDebug.log("test2"); diff --git a/ts/index.ts b/ts/index.ts index 290561a..7c6a728 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -1,12 +1,12 @@ /// -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; diff --git a/ts/test.ts b/ts/test.ts index e69de29..e8f7075 100644 --- a/ts/test.ts +++ b/ts/test.ts @@ -0,0 +1,5 @@ +var smartDebug = require("./index.js"); + +smartDebug.log("test"); +smartDebug.activate(true); +smartDebug.log("test2"); \ No newline at end of file