6.12.0 • Published 2 years ago

@ledgerhq/logs v6.12.0

Weekly downloads
35,742
License
Apache-2.0
Repository
github
Last release
2 years ago

@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

type

A namespaced identifier of the log (not a level like "debug", "error" but more like "apdu", "hw", etc...)

Type: LogType

data

Data associated to the log event

Type: LogData

context

Context data, coming for example from the caller's parent, to enable a simple tracing system

Type: TraceContext

id

Unique id among all logs

Type: string

log

Logs something

Parameters

  • type LogType 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 LogData?

trace

A simple tracer function, only expanding the existing log function

Its goal is to capture more context than a log function. This is simple for now, but can be improved later.

Parameters

  • context {type: LogType, message: string?, data: LogData?, context: TraceContext?} Anything representing the context where the log occurred

    • context.type
    • context.message
    • context.data
    • context.context

LocalTracer

A simple tracer class, that can be used to avoid repetition when using the trace function

Its goal is to capture more context than a log function. This is simple for now, but can be improved later.

Parameters

  • type A given type (not level) for the current local tracer ("hw", "withDevice", etc.)
  • context Anything representing the context where the log occurred

withType

Create a new instance of the LocalTracer with an updated type

It does not mutate the calling instance, but returns a new LocalTracer, following a simple builder pattern.

Parameters
  • type LogType

Returns LocalTracer

withContext

Create a new instance of the LocalTracer with a new context

It does not mutate the calling instance, but returns a new LocalTracer, following a simple builder pattern.

Parameters
  • context TraceContext? A TraceContext, that can undefined to reset the context

Returns LocalTracer

withUpdatedContext

Create a new instance of the LocalTracer with an updated context, on which an additional context is merged with the existing one.

It does not mutate the calling instance, but returns a new LocalTracer, following a simple builder pattern.

Parameters
  • contextToAdd TraceContext

Returns LocalTracer

listen

Adds a subscribers to the emitted 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

@everything-registry/sub-chunk-540paras-wallet-selectorparas-wallet-selector-here-walletwallet-btc@ultronswap.wormhole/wormhole-connect@aleworm/hw-transport-node-hid@aleworm/hw-transport-node-hid-noevents@backpacker69/hw-app-btc@backpacker69/hw-transport-webusb@blooo/hw-app-acre@blooo/hw-app-klaytn@blooo/hw-app-velas@claymore365123/hw-app-eth@codewarriorr/hw-app-btcv@codewarriorr/live-common@fluent-wallet/hw-app-conflux@ledgerhq/devices@ledgerhq/domain-service@ledgerhq/device-core@ledgerhq/hw-app-btc@ledgerhq/coin-polkadot@ledgerhq/coin-solana@ledgerhq/coin-stellar@ledgerhq/coin-tezos@ledgerhq/coin-ton@ledgerhq/coin-tron@ledgerhq/coin-evm@ledgerhq/coin-framework@ledgerhq/coin-icon@ledgerhq/coin-near@ledgerhq/coin-bitcoin@ledgerhq/coin-cardano@ledgerhq/coin-cosmos@ledgerhq/coin-elrond@ledgerhq/hw-app-eth@ledgerhq/hw-transport@ledgerhq/hw-transport-http@ledgerhq/hw-transport-node-hid@ledgerhq/hw-transport-node-hid-noevents@ledgerhq/hw-ledger-key-ring-protocol@ledgerhq/hw-transport-node-hid-singleton@ledgerhq/hw-transport-node-speculos@ledgerhq/hw-transport-mocker@ledgerhq/hw-transport-node-ble@ledgerhq/hw-app-vet@ledgerhq/live-cli@ledgerhq/live-common@ledgerhq/hw-transport-webusb@ledgerhq/ledger-key-ring-protocol@ledgerhq/speculos-transport@loon3/hw-app-btc@ledgerhq/live-wallet@ledgerhq/hw-transport-web-ble@ledgerhq/hw-transport-webauthn@ledgerhq/hw-transport-webhid@ledgerhq/hw-transport-node-speculos-http@ledgerhq/hw-transport-u2f@ledgerhq/hw-transport-vault@ledgerhq/live-countervalues@ledgerhq/live-countervalues-react@ledgerhq/live-network@ledgerhq/live-promise@ledgerhq/react-native-hid@ledgerhq/react-native-hw-transport-ble@ledgerhq/vault-common@ledgerhq/wallet-btc@empiricalrun/hw-transport-speculos-http@emurgo/react-native-hid@iotexproject/hw-transport-node-hid@openocean.finance/wallet@pocketbitcoin/hw-app-btc@pollum-io/sysweb3-keyring@owdin/live-commonself_signaturesnear-wallet-selectorhw-transport-node-speculos-httphw-ledger-provideridena-jshw-app-dfiledger-liveledger-xtz@waves/ledger@wavesenterprise/west-ledger@wormhole-foundation/wormhole-connect@trustcrypto/devices@trustcrypto/hw-transport-node-hid@trustcrypto/hw-transport-node-hid-keyboard@trustcrypto/hw-transport-node-hid-noevents@ultron.foundation/wormhole-connect@us3r-network/wormhole-connect@v-almonacid/react-native-hidaccumulate.jsccebdecimal-js-sdkdelysium-wormhole-connect@shapeshiftoss/hdwallet-ledger-webusb
6.11.0

2 years ago

6.11.0-nightly.0

2 years ago

6.11.0-next.0

2 years ago

6.12.0-nightly.0

2 years ago

6.12.0

2 years ago

6.12.0-next.0

2 years ago

6.10.1-next.0

3 years ago

6.10.1

3 years ago

6.10.1-nightly.1

3 years ago

6.10.1-nightly.0

3 years ago

6.9.1-taproot.0

4 years ago

6.10.0

4 years ago

6.2.0-bsc.5

4 years ago

6.2.0-bsc.4

4 years ago

6.2.0

4 years ago

6.2.0-bsc.1

4 years ago

6.2.0-bsc.2

4 years ago

6.2.0-bsc.3

4 years ago

6.2.0-bsc.0

4 years ago

6.0.1

4 years ago

6.0.0

4 years ago

6.0.2

4 years ago

6.0.0-rc.0

4 years ago

6.0.0-alpha.5

4 years ago

5.48.1-alpha.25

4 years ago

5.50.0

4 years ago

5.49.0

4 years ago

5.48.1-uglify.0

4 years ago

5.48.0

4 years ago

5.46.0

4 years ago

5.43.0

4 years ago

5.41.0

4 years ago

5.39.2

4 years ago

5.40.0

4 years ago

5.39.0

4 years ago

5.38.0

4 years ago

5.36.0

5 years ago

5.30.0

5 years ago

5.29.0

5 years ago

5.28.0

5 years ago

5.26.0

5 years ago

5.25.0

5 years ago

5.23.0

5 years ago

5.22.0

5 years ago

5.21.0

5 years ago

5.19.1

5 years ago

5.19.0

5 years ago

5.17.0

5 years ago

5.15.0

5 years ago

5.13.1

5 years ago

5.13.0

5 years ago

5.11.0

5 years ago

5.9.0

5 years ago

5.6.0

5 years ago

5.3.0

5 years ago

5.2.0

6 years ago

5.1.1-alpha.2

6 years ago

5.0.0

6 years ago

5.0.0-babel7.4

6 years ago

5.0.0-rc.4

6 years ago

5.0.0-babel7.3

6 years ago

5.0.0-babel7.1

6 years ago

5.0.0-alpha.7

6 years ago

4.74.3-alpha.6

6 years ago

5.0.0-alpha.5

6 years ago

5.0.0-alpha.4

6 years ago

5.0.0-alpha.3

6 years ago

5.0.0-alpha.1

6 years ago

4.72.0

6 years ago

4.70.0

6 years ago

4.69.3-alpha.1

6 years ago

4.68.2

6 years ago

4.64.0

6 years ago

4.62.0

6 years ago

4.61.0

6 years ago

4.60.3

6 years ago

4.60.2

6 years ago

4.60.0

6 years ago

4.59.1-alpha.2

6 years ago

4.58.0

6 years ago

4.56.0

6 years ago