cf-log
A conditional logger with colored labels
Last updated 4 years ago by creativeflume .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install cf-log 
SYNC missed versions from official npm registry.

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.

Installation

npm install cf-log

Example Usage

import logger from 'cf-log';

logger.log({
  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. The env map may contain any arbitrary mapping of environment variables to values.

Colors

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

Imagery

Current Tags

  • 0.1.10                                ...           latest (4 years ago)

11 Versions

  • 0.1.10                                ...           4 years ago
  • 0.1.9                                ...           4 years ago
  • 0.1.8                                ...           4 years ago
  • 0.1.7                                ...           4 years ago
  • 0.1.6                                ...           4 years ago
  • 0.1.5                                ...           4 years ago
  • 0.1.4                                ...           4 years ago
  • 0.1.3                                ...           4 years ago
  • 0.1.2                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (6)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |