Socket
Socket
Sign inDemoInstall

simple-debug

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    simple-debug

simple tool to limit log output


Version published
Maintainers
1
Install size
11.9 kB
Created

Readme

Source

simple-debug Build Status

Simple tool to limit log output. It's configuration is compatible with visionmedia/debug.

Examples

Basic

var debug = require('simple-debug')('mything');

setInterval(function(){
  debug('doing something useful');
}, 1000);

The DEBUG environment variable used to enable logging. Give it space- or comma-separated names.

$ DEBUG=mything node myapp
doing something useful
doing something useful
doing something useful

Multiple

var debug = require('simple-debug');
debug.working = debug('working');
debug.waiting = debug('waiting');

setInterval(function(){
  debug.working('doing something useful');
  // ...
  debug.waiting('pausing for 1s');
}, 1000);

Turn on only the waiting log.

$ DEBUG=waiting node myapp
pausing for 1s
pausing for 1s

Turn on both.

$ DEBUG=waiting,working node myapp
doing something useful
pausing for 1s
doing something useful
pausing for 1s

Output Stream

Send output through console.err instead of console.log.

var debug = require('simple-debug')('mything');
debug.log = console.error.bind(console);

setInterval(function(){
  debug('doing something useful');
}, 1000);

License

MIT. The core functions were extracted from debug. See LICENSE for details.

Keywords

FAQs

Last updated on 24 Oct 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc