Skip to content

cryo2010/null-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

null-log is a null logging module. It provides a means by which to disable logging via the Null Object pattern.

Installation

npm install null-log

Usage Example

const NullLogger = require('null-log');

class Foo {
  constructor(logger) {
    this.logger = logger || new NullLogger();
  }

  bar() {
    this.logger.info('Informational message');
  }
}

API

Logger.info(..)
Logger.log(..)
Logger.debug(..)
Logger.warn(..)
Logger.error(..)
Logger.fatal(..)

About

A Javascript null logging library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published