log-suppress

1.0.3 • Public • Published

log-suppress

build-status

A little tool that intercepts console.log output. Ideal for keeping tests output clean.

Especially handy for automated tests so that debug statements don't appear in the middle of test output.

Installation

npm install log-suppress --save

Usage

Log-Suppress takes the current console and optional environment

require("log-suppress").init(console);

Or for a specific environment

process.env.NODE_ENV = 'test'
require("log-suppress").init(console, 'test');

Other console modules

Using LogSuppress with other console loggers

require('console-ten').init(console);
require("log-suppress").init(console, 'test')
 

Developing Log-Suppress

If you are planning to fork this repo and continue developing it then here's some info.

Testing

Run the bash tests

make test

Automated Build

This package used travis to perform automated builds (see that build graphic at the top)

travis-ci

Package Sidebar

Install

npm i log-suppress

Weekly Downloads

6

Version

1.0.3

License

ISC

Last publish

Collaborators

  • jnyryan