better-debug
v0.4.0
Published
A better alternative to debug module
Downloads
49
Readme
Better Debug
A better alternative to debug
module.
Installation
With npm...
npm install --save better-debug
Usage
var debug = require('better-debug')('main');
debug.log('Test'); // app:main:log Test
debug.info('Test %d', 0); // app:main:info Test 0
debug.warn(new Error('Test')); // app:main:warn { [Error: Test] }
debug.error(new Error('Test'), { method: 'testMethod', 'location': 'index.js', }); // app:main:error { [Error: Test] method: 'testMethod', location: 'index.js' }
You can filter everything with the env variable DEBUG
.
For example, DEBUG=app:*:info node .
will only output debug.info
calls.