Skip to content

oziks/chuchote

Repository files navigation




Configurable JavaScript logger.

NPM Version NPM Downloads Build Status codecov

Installation

$ yarn add chuchote

Getting Started

chuchote expose a createLogger function which allows you to create a personalized logger.

const chuchote = require("chuchote");

const log = chuchote.createLogger({
  filterLevel:
    process.env.NODE_ENV === "production"
      ? chuchote.logLevel.OFF
      : chuchote.logLevel.INFO,

  handler: (messages, { level }) => {
    console.log(`${level.name}: ${messages[0]}`);
  }
});

log.error("You made a mistake");