dbug
A drop-in replacement for debug, for slightly more utility.
var dbug = require('dbug')('foo:bar');
dbug('just like debug');
dbug(new Error('also like debug'));
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:*
A user script wanting to dynamically enable or disable can do it a
couple ways:
require('dbug').env = 'foo,quux';
var foo = require('dbug')('foo');
foo.enabled = true;