0.2.17 • Published 5 years ago

@wirelineio/probe v0.2.17

Weekly downloads
1
License
GPL-3.0
Repository
github
Last release
5 years ago

What is @wirelineio/probe?

@wirelineio/probe is a small utility library for diagnostics.

How do I use it?

To use @wirelineio/probe, first require the @wirelineio/probe module in your code:

require('@wirelineio/probe');

It is activated at runtime via the WIRE_INSPECT environment variable when used in NodeJS or localStorage.wireInspect setting when used in the browser.

The value should either be * to enable everything, or a comma-separated list of specific behaviors to activate.

@wirelineio/probe uses the debug package for logging, so you will usually enable them together, for example:

For example:

WIRE_INSPECT='*' DEBUG='*' node ./src/index.js

or

localStorage.wireInspect = 'event-tracing'
localStorage.debug = 'event-tracing:*'

Behaviors

  • event-tracing Monkey patches EventEmitter to log when and where events are attached and emitted.
    When emitted, not only the current callstack is shown, but also the callstack from when the event handler was attached.
events:EventEmitter:documents.crdt -> +1s [ 'dWhCnuSlTkKR2qGgVKoIcQ-0', 'jjjj\nk', true ] 

================== EMIT STACK:

{anonymous}()@http://localhost:8080/app.js:490506:18 

~~~~~~~~~~~~~~~~~~ ATTACH STACK(s):

Indexer.onChange()@http://localhost:8080/app.js:490639:16
documentChanged()@http://localhost:8080/app.js:501657:34
{anonymous}()@http://localhost:8080/app.js:484713:22
done()@http://localhost:8080/app.js:198524:21
Item.../../node_modules/process/browser.js.Item.run()@http://localhost:8080/app.js:373766:14
drainQueue()@http://localhost:8080/app.js:373736:42

------------------
==================