Highway to the logging zone
Want to see pretty graphs? Log in now!
npm install kenny-loggins
|1||downloads in the last week|
|8||downloads in the last month|
|Last Published By|
|Version||0.0.1 last updated 10 months ago|
|Dependencies||funstance, through, logref|
Yet another logging library
Whirlwind Tour (will get better later I promise)
var loggins = require('kenny-loggins'); loggins.info('oh hey'); // totally cool!
The default loggins is already piped to stdout, but if you want a clean one go for it:
var kenny = loggins(); loggins.pipe(fs.createWriteStream('./log.log'));
It takes an optional arguments hash with values:
opts.levels: Either a list of levels, or key-value pairs of the form
This returns a stream which outputs pretty-printed logging events.
logger will have a method for every level. For example:
logger.info('this is some info');
logger.info is also a readable/writable stream. As a writable stream, it will
log each chunk as a logging message. As a readable stream, it just emits the
logger.raw is the same as 'logger' except the chunks are in JSON format.
logger._pretty is used to format an object with the keys "level" and
"message". You can punch this to customize what prettiness looks like. By
default colorizes the message if
logger.colors[level] is defined, using some
copypasta from the colors library to avoid punching the prototype
(looking for a better solution!!!).
- Works in browserify, even with the same text colors as the console
- logger.logging is a https://github.com/mikeal/logref
- Way way way better docs
- Special cases for formatting errors?