1.0.3 • Published 8 years ago

null-log v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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