better-debug

0.4.0 • Public • Published

Better Debug

Circle CI npm npm Codacy Codecov VersionEye

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.

Readme

Keywords

Package Sidebar

Install

npm i better-debug

Weekly Downloads

14

Version

0.4.0

License

LGPL-3.0

Last publish

Collaborators

  • louy