Skip to content

lambdacasserole/log-color-optionaldate.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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-color-optionaldate');
var log = new Log('info');
log.info('Sent a message to the user@example.com');

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 user@example.com');

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'); 

About

Log.js fork of fork - colored logs with or without timestamp.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.2%
  • Makefile 4.8%