Skip to content

Conversation

@Alenar
Copy link
Collaborator

@Alenar Alenar commented Oct 17, 2024

Content

This PR refactor the log usage in mithril-relay:

  • A dedicated child logger is used for each service
  • Each child logger is tagged with its service name in order to identify quickly a log source without the need of a prefix in the log message.
  • Capitalize the first letters of all "functional" logs.
  • Remove slog_scope to enforce the usage of a name tagged child logger.
  • Move away from the log message into a property huge structure (ie: some logs joined errors into their message, those errors have been moved to a "error" property).

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Issue(s)

Closes #1981

@Alenar Alenar requested review from dlachaume and jpraynaud October 17, 2024 15:38
@Alenar Alenar self-assigned this Oct 17, 2024
@github-actions
Copy link

github-actions bot commented Oct 17, 2024

Test Results

    4 files  ±0     55 suites  ±0   10m 24s ⏱️ +5s
1 370 tests ±0  1 370 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 584 runs  ±0  1 584 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit a879a96. ± Comparison against base commit 495f150.

♻️ This comment has been updated with latest results.

@Alenar Alenar force-pushed the djo/1981/enhance_logs_in_relay branch from cb0883d to 881e3f2 Compare October 17, 2024 15:47
@Alenar Alenar temporarily deployed to testing-preview October 17, 2024 15:55 — with GitHub Actions Inactive
@Alenar Alenar temporarily deployed to testing-sanchonet October 17, 2024 15:55 — with GitHub Actions Inactive
Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Instead of passing only config parameters, this design allow to add
other shared dependencies such as a common logger.
+ remove `slog_scope`, now only used in integration tests.
And instead add them to a property. This allow to keep the main log
messages leans while still providing detailed errors info.
* Capitalize first letter of functionnal logs
so we are consistent accross all nodes.
* mithril-relay from `0.1.25` to `0.1.26`
@Alenar Alenar force-pushed the djo/1981/enhance_logs_in_relay branch from de04eb0 to a879a96 Compare October 18, 2024 09:55
@Alenar Alenar temporarily deployed to testing-preview October 18, 2024 10:13 — with GitHub Actions Inactive
@Alenar Alenar temporarily deployed to testing-sanchonet October 18, 2024 10:13 — with GitHub Actions Inactive
@Alenar Alenar merged commit 17c6d9a into main Oct 18, 2024
47 of 48 checks passed
@Alenar Alenar deleted the djo/1981/enhance_logs_in_relay branch October 18, 2024 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance readability of node logs

4 participants