New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

multilog

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multilog

Tagged logging. Includes multi-streamed logging and filtering.

latest
Source
npmnpm
Version
14.11.22
Version published
Weekly downloads
4.7K
225.55%
Maintainers
1
Weekly downloads
 
Created
Source

Multilog

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!

API

var log = require('multilog');
log('Curse your sudden but inevitable betrayal!', 'stderr');

You get the following functions:

  • log(statement, tag) function prints statement in tag channel (defaulting to the special "stdout" channel).
  • log.pipe(parentTag, tag) makes all parentTag statements be on the tag channel.
  • log.unpipe(parentTag, tag) undoes the corresponding pipe operation.

By default, pipes flow into void.

You can connect them to a writable stream with log.pipe(tag, process.stdout).

You can also ask that their logs be retained with log.retain(tag). You can then read from them (and from all tags that feeds to them) through log.read(tag), and flush the memory with log.flush(tag).

Advanced use:

  • log.tags(statement, tagList) prints statement on multiple tags.
  • log.stream(tag) returns a duplex Stream for a retained tag.

There are two special tags, stdout and stderr, which directly flush their statements to the corresponding pipeline.

Authorship

Thaddee Tyl © 2012-2014 released under Creative Commons License.

FAQs

Package last updated on 22 Nov 2014

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