log-color-optionaldate
v1.1.1
Published
Log.js fork of fork - colored logs with or without timestamp.
Downloads
5
Readme
Log.js (with color and optional timestamps)
This package is a fork of log-color.js which it itself a fork of Log.js.
Installation
Install using npm:
$ npm install log-color-optionaldate
Example
Can be used in a similar fashion to Log.js.
Code snippet:
var Log = require('log');
var log = new Log('info');
log.info('Sent a message to the [email protected]');
Enabling Color
Enable color like this:
var Log = require('log-color-optionaldate');
var log = new Log({ level: 'debug', color: true, date: false });
log.warning('Failed to send a message to the [email protected]');
Log Levels
The same log levels are available as in Log.js:
log.alert('alert');
log.critical('critical');
log.error('error');
log.warning('warning');
log.notice('notice');
log.info('info');
log.debug('debug');