edebug
tiny node.js debugging utility modelled after node core's debugging technique.
Installation
$ npm install edebug
Usage
With edebug
you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated console.err
, so all of the console
format string goodies you're used to work fine. A unique color is selected per-function for visibility.
Example app.js:
var edebug = require('edebug');
edebug.info('Hello World');
edebug.info('Hello World', true);
edebug.err('Hello World');
edebug.err('Hello World', true);
edebug.war('Hello World');
edebug.war('Hello World', true);
edebug.suc('Hello World');
edebug.suc('Hello World', true);
edebug.data('Hello World');
edebug.data('Hello World', true);
var mjson = {
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": {
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"]
},
"GlossSee": "markup"
}
}
}
}
}
edebug.json(mjson);
edebug.disable();
edebug.info('Hello World');
edebug.info('Hello World', true);
edebug.enable();
edebug.info('Hello World');
edebug.info('Hello World', true);
Authors
- Tarik