Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

cf-log

0.1.5 • Public • Published

cf-log

A Conditional Logger with Colored Labels for Node.js

A simple conditional logger for node.js. Each logging statement is configured with a title and message. You can optionally add a map of environment variables to check for prior to logging and label color.

Example Usage

import logger from 'cf-node-logger';

logger.logMessage({
  title: 'Request',
  message: 'Some cookies',
  env: {
    NODE_ENV: 'development',
    LOG_FEATURE: 'cookieJar'
  }
});

This block of code will log:

Request    Some cookies

when the environment variables NODE_ENV and LOG_FEATURE are set to their respective values.

Colors

  1. logger.green (default)
  2. logger.red
  3. logger.blue
  4. logger.yellow

Imagery

Install

npm i [email protected]

Version

0.1.5

License

MIT

Last publish

Collaborators

  • avatar