You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

log-color-optionaldate

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

log-color-optionaldate

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

1.1.1
latest
Source
npmnpm
Version published
Weekly downloads
9
200%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

log

FAQs

Package last updated on 06 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts