Skip to content

Visionmedia's debug, monkey patched to support hot enable/disable

Notifications You must be signed in to change notification settings

simonhac/hot-debug

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hot-debug Build Status

Visionmedia's debug, monkey patched to support hot enable/disable

Usage

npm i --save hot-debug

require('hot-debug') before you import anything else - that way your sub-dependencies will pick up the monkey-patched module, and will get hot enable/disable goodness!

API

All the wholesome goodness of visionmedia/debug but with the addition of an .enable([opt: isEnabled]) method on individual debug channels.

Example

require('hot-debug');

var httpLog = require('debug')('http');
var workerLog = require('debug')('worker');

function configureDebug(config) {
  httpLog.enable(config.log.http);
  workerLog(config.log.workerLog);
}

You don't need to change your imports at all - just go on using require('debug')(...) and everything will be the same. Except when you call enable(), existing instances will be updated!

About

Visionmedia's debug, monkey patched to support hot enable/disable

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%