dd
debug-dude
npm i debug-dude
dd

debug-dude

Thin wrapper around visionmedia`s debug

by Igor Ovsiannikov

1.0.3 (see all)License:MITTypeScript:Not Found
npm i debug-dude
Readme

debug-dude

A thin wrapper around visionmedia`s debug

It exposes a factory having same signature as visionmedia`s debug, but returns an object with several logger instances.

How to use (es6)

// file: example_dude.js
import dude from 'debug-dude';

const { debug, log, info, warn, error } = dude('my:space');

log('hello!');
warn('beware of wolfs');
error('you shall not pass, dude!');

Console output

# log all
✗ DEBUG=* babel-node example_dude.js
  my:space:log hello! +0ms
  my:space:warn beware of wolfs +3ms
  my:space:error you shall not pass, dude! +2ms

# log only errors
✗ DEBUG=*error babel-node __test_dude.js
  my:space:error you shall not pass, dude! +0ms
  
# log all but errors  
✗ DEBUG=my:*,-*error babel-node __test_dude.js
  my:space:log hello! +0ms
  my:space:warn beware of wolfs +2ms

Downloads/wk

49

GitHub Stars

12

LAST COMMIT

7yrs ago

MAINTAINERS

1

CONTRIBUTORS

0

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
1.0.3
latest
7yrs ago
No alternatives found
No tutorials found
Add a tutorial