conflogger
Configure a logger
Last updated 4 years ago by austinkelleher .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install conflogger 
SYNC missed versions from official npm registry.

conflogger

Build Status NPM version

Small module for configuring a logger. Falls back to noops for methods that do not exist in the logger passed.

Installation

npm install conflogger --save

Usage

Conflogger can take a provided logger and fill methods that do not exist

const conflogger = require('conflogger');

let originalLogger = {
  info(msg) {
    console.log(msg);
  }
};

let logger = conflogger.configure(originalLogger);

// Prints `Conflogger!`
logger.info('Conflogger!');

// Prints `Error!`
logger.error('Error!');

Conflogger can give you a basic logger. Free. Of. Charge.

const conflogger = require('conflogger');

let logger = conflogger.configure(true);

// Prints `Conflogger!`
logger.info('Conflogger!');

// Prints `Error!`
logger.error('Error!');

Conflogger can even give you a noop logger. Woah.

const conflogger = require('conflogger');

let logger = conflogger.configure();

// Does not print anything
logger.info('Conflogger!');

// Does not print anything
logger.error('Error!');

Current Tags

  • 1.0.5                                ...           latest (3 years ago)

6 Versions

  • 1.0.5                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 3
Dependencies (2)
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |