Tagged logging. Includes multi-streamed logging and filtering.
Want to see pretty graphs? Log in now!
npm install multilog
|8||downloads in the last month|
|Last Published By|
|Version||13.6.7 last updated a few seconds ago|
a fun and collateral way to print logs
Each statement you log is associated to a tag, and some tags can be associated to writable streams.
You can also file tags under other tags, so that all statements in a child tag are printed to the parent tag's writable stream!
var log = require('multilog');
You get the following functions:
log(tag, statement)function prints
log.read(tag)returns a string of all logs in that tag.
log.pipe(parentTag, tag)makes all
parentTagstatements be on the
statementon multiple tags.
log.flush(tag)clears all data stored in
tagand its children.
There are two special tags,
stderr, which directly flush their
statements to the corresponding pipeline. All other tags are readable:
log('myTag', 'I have something to say'); log.read('myTag') // 'I have something to say\n'