0.4.2 • Published 9 years ago

dbug v0.4.2

Weekly downloads
283,749
License
MPLv2.0
Repository
github
Last release
9 years ago

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:*

A user script wanting to dynamically enable or disable can do it a couple ways:

require('dbug').env = 'foo,quux'; // just like ENV var
var foo = require('dbug')('foo');
foo.enabled = true;
0.4.2

9 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.0

11 years ago