Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance logs in client and client-cli #2013

Merged
merged 9 commits into from
Oct 17, 2024
Merged

Conversation

Alenar
Copy link
Collaborator

@Alenar Alenar commented Oct 17, 2024

Content

This PR refactor the log usage in mithril-client and mithril-client-cli:

  • A dedicated child logger is used for each service (only mithril-client)
  • 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.
  • Change the name property in all logs from the default slog-rs to mithril-client (only mithril-client-cli).
  • 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)

Relates to #1981

@Alenar Alenar self-assigned this Oct 17, 2024
Copy link

github-actions bot commented Oct 17, 2024

Test Results

    4 files  ±0     55 suites  ±0   10m 28s ⏱️ -2s
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 99bf8c3. ± Comparison against base commit 7f3f4e5.

♻️ This comment has been updated with latest results.

@Alenar Alenar force-pushed the djo/1981/enhance_logs_in_client branch from 99ee776 to d5119f4 Compare October 17, 2024 10:28
Base automatically changed from djo/refactor_client_cli_command_params to main October 17, 2024 10:40
* Move away from main log message to a property huge structure
* Reduce space taken by some logs when possible
Use full path instead of needing a use gated by an `cfg(test)` that add
noises with the other imports.
* Move away from main log message to a property huge structure
* Reduce space taken by some logs when possible
@Alenar Alenar force-pushed the djo/1981/enhance_logs_in_client branch from d5119f4 to 808ae15 Compare October 17, 2024 10:49
Copy link
Collaborator

@dlachaume dlachaume left a comment

Choose a reason for hiding this comment

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

LGTM 👍

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 👍

* mithril-client-cli from `0.9.16` to `0.9.17`
* mithril-client from `0.9.2` to `0.9.3`
@Alenar Alenar merged commit a3bbf33 into main Oct 17, 2024
48 checks passed
@Alenar Alenar deleted the djo/1981/enhance_logs_in_client branch October 17, 2024 15:06
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.

3 participants