JSPM

  • Created
  • Published
  • Downloads 16
  • Score
    100M100P100Q57426F
  • License MIT

Verbose logging features for ttys or any writable stream.

Package Exports

  • verbosity

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (verbosity) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

verbosity

An augmented drop-in console replacement that supports logging levels.

Status

Status npm Travis David
Code-climate Coverage Snyk

Developer

David-developer Rollup

Help

Inch Gitter

Usage

Installation

npm install --save verbosity

Examples

Simply override the built in console object:

const console = require('../../index.js').createConsole({
    outStream: process.stdout,
    errorStream: process.stderr,
    verbosity: 5
})

This will direct all console output to stderr, but silence 'info' and 'debug' messages.

const console = require('../../index.js').createConsole({
    outStream: process.stderr,
    verbosity: 3
})

console.log('Picked brown jacket...') // Printed
console.debug('Purple tie chosen...') // Not printed
console.warn("That tie doesn't go with that jacket.") // Printed

Or go mad with making up any number of custom console writers.

const myUberConsole = require('../../index.js').createConsole({
    outStream: myFancyWriteableStream,
    verbosity: 5
})

myUberConsole.panic('Core Flux Capacitor Meltdown!')

Documentation

Full documentation can be found at https://markgriffiths.github.io/verbosity/