[go: nahoru, domu]

Skip to content

austinkelleher/conflogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!');

About

Configure a super basic logger

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published