consolation
v0.2.4
Published
Add some flavors to node's default console.log
Downloads
6
Readme
consolation
This module adds some sprinkles to node's vanilla console.
##How it looks
##Getting started ###Installation
npm install consolation
Basic usage
var consolation = require ('consolation');
var console = new consolation ();
console.ok ('This console.log is OK');
console.info ('This console.log is an INFO');
console.err ('This console.log is an ERROR');
console.warn ('This console.log is a WARNING');
###Options You can pass options when creating the object:
var console = new consolation ({
title: 'My cool title', use_time: false, use_symbols: false, log_level: 'warn'
});
Available options:
title [String]
: the title of your logger, usually (but not necessarily) the name of the file (default is nothing),use_time [Boolean]
: whether to display the time on each log line (defaulttrue
),use_symbols [Boolean]
: whether to display a nice unicode symbol at the end of each log line (default istrue
),log_level [String]
: the minimum level from which logs are displayed (can take values from['info', 'ok', 'warn', 'err']
, and default is'info'
),monochrome [Boolean]
: output black and white log lines. This is useful when you need to output log lines to a file (default isfalse
).
##Tests Testing is done using mocha and should.js so you might wanna get your hands on those as well:
make install && npm install mocha -g
and then:
make test
Misc.
PR, comments and suggestions are welcome !