feat: Enable line numbers for logs when using RUST_LOG#3211
Merged
Bravo555 merged 1 commit intothin-edge:mainfrom Oct 29, 2024
Merged
feat: Enable line numbers for logs when using RUST_LOG#3211Bravo555 merged 1 commit intothin-edge:mainfrom
Bravo555 merged 1 commit intothin-edge:mainfrom
Conversation
RUST_LOG can be used to more precisely control logging configuration and is undocumented and used by developers. For this reason, I think when using it we can enable line numbers to show the location of the log statement to more easily find relevant code. Example (issue thin-edge#2739): ```sh tedge mqtt pub -r te/device/child1///cmd/config_update '' ``` tedge-mapper-c8y output: ``` 2024-10-29T09:58:14.710505474Z ERROR c8y_mapper_ext::converter: crates/extensions/c8y_mapper_ext/src/converter.rs:139: Mapping error: EOF while parsing a value at line 1 column 0 ``` Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files📢 Thoughts on this report? Let us know! |
Contributor
Robot Results
|
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.
Proposed changes
RUST_LOG can be used to more precisely control logging configuration and is undocumented and used by developers. For this reason, I think when using it we can enable line numbers to show the location of the log statement to more easily find relevant code.
Example (issue #2739):
Start
tedge-mapperwithRUST_LOG:Publish a message to trigger some error log:
tedge mqtt pub -r te/device/child1///cmd/config_update ''tedge-mapper-c8y output:
Types of changes
Paste Link to the issue
Checklist
cargo fmtas mentioned in CODING_GUIDELINEScargo clippyas mentioned in CODING_GUIDELINESFurther comments