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

Add tracing for extra structured debug logging #129

Merged
merged 1 commit into from
Oct 15, 2021
Merged

Add tracing for extra structured debug logging #129

merged 1 commit into from
Oct 15, 2021

Conversation

foresterre
Copy link
Owner

No description provided.

@foresterre foresterre changed the title WIP init tracing Add tracing for extra debug logging Oct 12, 2021
@foresterre foresterre changed the title Add tracing for extra debug logging Add tracing for extra structured debug logging Oct 12, 2021
@codecov
Copy link

codecov bot commented Oct 12, 2021

Codecov Report

Merging #129 (dcb4e83) into main (b2eb374) will decrease coverage by 11.32%.
The diff coverage is 33.33%.

❗ Current head dcb4e83 differs from pull request most recent head 0e51a0f. Consider uploading reports for the commit 0e51a0f to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##             main     #129       +/-   ##
===========================================
- Coverage   55.92%   44.60%   -11.33%     
===========================================
  Files          13       12        -1     
  Lines         751      639      -112     
===========================================
- Hits          420      285      -135     
- Misses        331      354       +23     
Impacted Files Coverage Δ
src/bin/cargo-msrv.rs 0.00% <0.00%> (ø)
src/errors.rs 0.00% <0.00%> (ø)
src/lib.rs 38.84% <0.00%> (-16.16%) ⬇️
src/reporter/json.rs 0.00% <ø> (ø)
src/reporter/mod.rs 87.50% <ø> (ø)
src/reporter/ui.rs 0.00% <0.00%> (ø)
src/config.rs 69.23% <66.66%> (-2.63%) ⬇️
src/check.rs 95.16% <100.00%> (+0.33%) ⬆️
src/cli.rs 84.37% <100.00%> (+0.50%) ⬆️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b2eb374...0e51a0f. Read the comment docs.

@foresterre
Copy link
Owner Author

bors r+

bors bot added a commit that referenced this pull request Oct 15, 2021
129: Add tracing for extra structured debug logging r=foresterre a=foresterre



Co-authored-by: Martijn Gribnau <garm@ilumeo.com>
@foresterre
Copy link
Owner Author

bors r-

@bors
Copy link
Contributor

bors bot commented Oct 15, 2021

Canceled.

…sers

Adds logic to initialize tracing. The tracing information is logged to a file, which will be rotated daily.
The events logged using tracing may be more detailed, or simply different from the output we would like to show users.

Tracing may be disabled by running cargo-msrv with the `--no-log` flag. In that case, not even a log file will be created, which may be useful if the log file location (which is currently not configurable) is inaccessible.

For the implementation it is important that we always collect the guards of the non-blocking tracing appender(s), since they will only live as long as the lifetime of the worker guard. If we don't do this, the guards would be dropped after the scope of `if !config.no_tracing() { ... }` ended, and as a result, anything logged in `init_and_run` would not be logged.
@foresterre
Copy link
Owner Author

bors r+

@bors bors bot merged commit 9e90aee into main Oct 15, 2021
@foresterre foresterre deleted the tracing branch October 28, 2021 08:58
foresterre added a commit that referenced this pull request Aug 1, 2022
129: Add tracing for extra structured debug logging r=foresterre a=foresterre



Co-authored-by: Martijn Gribnau <garm@ilumeo.com>
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.

1 participant