1.0.1 • Published 7 years ago

rainbow-log v1.0.1

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

rainbow-log

Travis CI npm npm npm

An alternative to console methods, prefixed with timestamp and pretty output.

Why use rainbow-log?

  • don't have to write console everytime
  • timestamp is include on every log message
  • log messages are pretty on terminal, different color used for different console method for easier readability

Install

This module is distributed via npm which is bundled with node and should be installed as one of your project's dependencies:

$ npm install --save rainbow-log

Usage

var log = require('rainbow-log');

log('Message');
//~{13:10:14} Message

log.error('Snap. Error!');
//~{13:10:15} Snap. Error!

log.info('Just an info message');
//~{13:10:17} Just an info message

API

log(msg)

similar to console.log, default output, prefixes the output with current time in HH:mm:ss format

log.error(msg)

similar to console.error, prefixes the output with current time in HH:mm:ss format

log.warn(msg)

similar to console.warn, prefixes the output with current time in HH:mm:ss format

log.dir(msg)

similar to console.dir, prefixes the output with current time in HH:mm:ss format

log.info(msg)

similar to console.info, prefixes the output with current time in HH:mm:ss format

log.trace(msg)

similar to console.trace, for tracing stack, prefixes the output with current time in HH:mm:ss format


License

Copyright (c) 2016 Aman Mittal