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 machine readable logs in client #1400

Merged
merged 7 commits into from
Dec 18, 2023

Conversation

dlachaume
Copy link
Collaborator

@dlachaume dlachaume commented Dec 15, 2023

Content

This PR includes an update of mithril-client-cli.

  • Fix the case inconsistency issue (use only snake case now).
  • Fix a formatting problem with seconds_left and seconds_elapsed ("5s" and "001ms" was formatted as "5.1" in logs, instead of "5.001").
  • Add timestamp in JSON progress logs.
  • Add --log-format-json argument in mithril-client-cli commands, which displays slog logs in json format.
  • Add --log-output argument in mithril-client-cli commands to redirect the slog logs to a file.

Important

This PR includes impacting modifications mithril-client-cli. JSON progress logs were modified:

  • bytesDownloaded is now bytes_downloaded
  • bytesTotal is now bytes_total
  • secondsLeft is now seconds_left
  • secondsElapsed is now seconds_elapsed

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are 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
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)

Issue(s)

Closes #1234

Copy link

github-actions bot commented Dec 15, 2023

Test Results

    3 files  ±  0    32 suites  ±0   7m 36s ⏱️ -28s
739 tests +  4  739 ✔️ +  4  0 💤 ±0  0 ±0 
816 runs  +12  816 ✔️ +12  0 💤 ±0  0 ±0 

Results for commit 9f17b50. ± Comparison against base commit b7e4f13.

♻️ This comment has been updated with latest results.

@dlachaume dlachaume marked this pull request as ready for review December 15, 2023 13:35
@dlachaume dlachaume self-assigned this Dec 15, 2023
@dlachaume dlachaume force-pushed the ensemble/1234/enhance-machine-readable-logs-in-client branch from bc7eb7d to fccd874 Compare December 15, 2023 16:42
@dlachaume dlachaume force-pushed the ensemble/1234/enhance-machine-readable-logs-in-client branch from fccd874 to a3e6629 Compare December 18, 2023 11:06
@dlachaume dlachaume force-pushed the ensemble/1234/enhance-machine-readable-logs-in-client branch from a3e6629 to 8e2400d Compare December 18, 2023 11:22
@dlachaume dlachaume force-pushed the ensemble/1234/enhance-machine-readable-logs-in-client branch from 8e2400d to be1a77b Compare December 18, 2023 11:31
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 👍

- Add new parameter `json_output` at a global level
- Move `--json` parameter to commands level
@dlachaume dlachaume force-pushed the ensemble/1234/enhance-machine-readable-logs-in-client branch from be1a77b to 9f17b50 Compare December 18, 2023 13:27
@dlachaume dlachaume merged commit fd781fb into main Dec 18, 2023
32 checks passed
@dlachaume dlachaume deleted the ensemble/1234/enhance-machine-readable-logs-in-client branch December 18, 2023 13:37
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 machine readable logs in client
3 participants