null-log

1.0.3 • Public • Published

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(..)

Readme

Keywords

none

Package Sidebar

Install

npm i null-log

Weekly Downloads

2

Version

1.0.3

License

MIT

Last publish

Collaborators

  • cryo2010