Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

electrum-trace

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electrum-trace

Electrum Trace provides a logging abstraction.

  • 1.1.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-99.14%
Maintainers
1
Weekly downloads
 
Created
Source

Electrum Trace

The Trace class provides static tracing functions:

  • log(), info(), warn() and error() which are by default forwarding to console.
  • dir() which is by default forwarding to console too.

The user of Trace can reconfigure the tracing:

  • intercept(name, func) → intercepts the named call and calls func before calling the default. Multiple calls to intercept can be donc with the same name. The calls will be dispatched first to the last added funciton.
  • reset() → resets to the default forwarding.
  • clear() → clears all forwarding, making calls to log(), etc. equivalent to a no-op.
  • clear(name) → clears the named call; this replaces it with a no-op.
  • clear(name1, name2, ...) → clears multiple named calls.

How to use

Install with:

npm install electrum-trace

Import with:

import Trace from 'electrum-trace';

and use like this:

Trace.log ('Hello, world');

// With interception
Trace.intercept ('log', x => { /* do something */ });
Trace.log ('Hello, world');

// Resetting interception
Trace.reset ();
Trace.log ('Hello, world');

// Suppressing messages
Trace.clear ('log');
Trace.log ('Hello, world');

FAQs

Package last updated on 02 Apr 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc