Repository navigation
feat: setup new log system and record logs from LLD internal thread - #4709
Merged
alexandremgo merged 18 commits intoSep 21, 2023
Merged
Conversation
🦋 Changeset detectedLatest commit: 5f0c8af The changes in this PR will be included in the next version bump. This PR includes changesets to release 49 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
alexandremgo
force-pushed
the
feat/LIVE-9405-log-tracing-on-libs-LLD-LLM
branch
from
September 15, 2023 15:13
409f285 to
9c8f191
Compare
gre
reviewed
Sep 18, 2023
gre
left a comment
Contributor
There was a problem hiding this comment.
great rework overall. some minor comments
alexandremgo
force-pushed
the
feat/LIVE-9405-log-tracing-on-libs-LLD-LLM
branch
from
September 18, 2023 13:12
65cadd0 to
3e6617e
Compare
|
Deployment failed with the following error: |
gre
approved these changes
Sep 19, 2023
alexandremgo
force-pushed
the
feat/LIVE-9405-log-tracing-on-libs-LLD-LLM
branch
from
September 20, 2023 09:09
63ba952 to
0f27710
Compare
Without breaking the behavior of the existing log function
The tracing helps keeping a context (for ex a `job id`) that is propagated to other logs, creating a tracing span
And enable filtering on logs displayed in the console for better debugging sessions
- Logs from the internal thread are forward to the main thread - The main thread records them, and can export them - If `VERBOSE` env var is set, filtered logs can be stdout from the main thread - Same from the renderer thread - Setup simple tracing system (context) on LLD
Avoiding any crash with try/catch when formatting
- and usage in LLM and LLD - also put LLM console logger mechanism in a class ConsoleLogger
Now manually JSON.stringify logs from the renderer thread before sending them to the main thread
The equivalent to the withDevice from a 1st version of the new device SDK
alexandremgo
force-pushed
the
feat/LIVE-9405-log-tracing-on-libs-LLD-LLM
branch
from
September 20, 2023 15:14
0f27710 to
1ab7bb2
Compare
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
lambertkevin
pushed a commit
that referenced
this pull request
Sep 22, 2023
`ledgerjs/logs`: * new `trace` and `LocalTracer` definitions, without breaking the behavior of the existing `log` function `hw-transport`, `hw-transport-node-hid-noevents`, `hw-transport-node-hid-singleton`, `react-native-hw-transport-ble`, `ledger-live-common` * Usage of new tracing system in some transports * The tracing helps keeping a context (for ex a `job id`) that is propagated to other logs, creating a (simple) tracing span Note on the "tracing": for now added a simple "context" that is propagated from `withDevice` to called functions, mainly from Transport. This is a preview of what could be done to have a real tracing system in the DeviceSDK Note: the optional `openTimeoutMs` on the different `open` function is necessary for legacy (used by one of the Transport), and will actually be used in the future. LLD: * Logs from the `internal` thread are forwarded to the `main` thread * The `main` thread records them, and can export them * on export, recorded logs from the `renderer` thread are sent to the `main` thread, and the `main` thread expand (not a merge, just pushed at the end) them with the logs it recorded from the `internal` thread * If `VERBOSE` env var is set, filtered logs can be stdout from the main thread * Same from the `renderer` thread * Setup simple tracing system (context) on LLD LLM: * Setup simple tracing system on LLM with context * If `VERBOSE` env var is set, filtered logs can be stdout from the main thread
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
ledgerjs/logstraceandLocalTracerdefinitions, without breaking the behavior of the existinglogfunctionhw-transport,hw-transport-node-hid-noevents,hw-transport-node-hid-singleton,react-native-hw-transport-ble,ledger-live-commonjob id) that is propagated to other logs, creating a (simple) tracing spanNote on the "tracing": for now added a simple "context" that is propagated from
withDeviceto called functions, mainly from Transport. This is a preview of what could be done to have a real tracing system in the DeviceSDKNote: the optional
openTimeoutMson the differentopenfunction is necessary for legacy (used by one of the Transport), and will actually be used in another PR. Don't mind it during the code review. But it should only by passed to a couple of other functions, not directly used (in this PR).LLD:
internalthread are forwarded to themainthreadmainthread records them, and can export themrendererthread are sent to themainthread, and themainthread expand (not a merge, just pushed at the end) them with the logs it recorded from theinternalthreadVERBOSEenv var is set, filtered logs can be stdout from the main threadrendererthreadUsage with
VERBOSE:LLM:
VERBOSEenv var is set, filtered logs can be stdout from the main threadUsage with
VERBOSE: in a.envfile, add (for ex)You will need to re-build fully the app so the new
.envfile is transfered.❓ Context
hw-transport,hw-transport-node-hid-noevents,hw-transport-node-hid-singleton,react-native-hw-transport-ble,ledger-live-common,ledgerjs/logs, LLM and LLD✅ Checklist
📸 Demo
LLD performance
Non-scientific manual measurements (on dev build): beginning of the fw update until the end of the fw transfer:
Measurements fw update transfer
With new log system (without
VERBOSE):Without new log system:
-> no obvious performance decline
Exported logs from LLD
Example separation `renderer` and `internal` thread
Stdout debug logs on LLD with
VERBOSELLD logs on terminal
Stdout debug logs on LLM with
VERBOSELLM logs on terminal
🚀 Expectations to reach