dbug

debug improvements

npm install dbug
85 downloads in the last day
346 downloads in the last week
1 172 downloads in the last month

dbug

Build Status NPM version

A drop-in replacement for debug, for slightly more utility.

var dbug = require('dbug')('foo:bar');

dbug('just like debug'); // except goes to stdout, not stderr
dbug(new Error('also like debug'));

// additional methods
dbug.info('info');
dbug.warn('warning');
dbug.error('red alert');

Just like debug, dbug won't do anything unless the DEBUG env variable matches the dbug logger, but with slightly more lenient matching.

DEBUG=*
DEBUG=foo,quux
DEBUG=foo // also acts as foo:*

However, dbug will now check for chages to the env variable, so a script can enable debugging even after the dbugger has been created.

npm loves you