@ledgerhq/logs

Ledger logs central point

Usage no npm install needed!

<script type="module">
  import ledgerhqLogs from 'https://cdn.skypack.dev/@ledgerhq/logs';
</script>

README

@ledgerhq/logs

Utility library that is used by all Ledger libraries to dispatch logs so we can deal with them in a unified way.

API

Table of Contents

Log

A Log object

log

log something

Parameters

  • type string a namespaced identifier of the log (it is not a level like "debug", "error" but more like "apdu-in", "apdu-out", etc...)
  • message string? a clear message of the log associated to the type
  • data any?

listen

listen to logs.

Parameters

  • cb Subscriber that is called for each future log() with the Log object

Returns Unsubscribe a function that can be called to unsubscribe the listener