Merged
Conversation
Codecov ReportAttention: Patch coverage is Additional details and impacted files📢 Thoughts on this report? Let us know! |
Contributor
Robot Results
|
Flags should always take precedence over environment variables because are often used by users to override the environment which they usually have little control over. To implement this change it was necessary to refactor the code a little bit as previously set_log_level function was not aware if desired log level was specifically requested by the user (--debug flag) or just the default (INFO level). As such, the new log_init function takes into account all sources that decide what log level we should select: CLI options, RUST_LOG env variable, and tedge configuration file. Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com>
Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com>
b505007 to
537e02d
Compare
Bravo555
commented
Oct 28, 2024
| log_init( | ||
| "tedge-mapper", | ||
| &mapper_opt.log_args, | ||
| &tedge_config_location.tedge_config_root_path, |
Member
Author
There was a problem hiding this comment.
Previously erroneously used &tedge_config_location.tedge_config_file_path instead of root_path here, squashed and rebased a fix.
ad03ca3
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
Flags should always take precedence over environment variables because are often used by users to override the environment which they usually have little control over.
To implement this change it was necessary to refactor the code a little bit as previously
set_log_levelfunction was not aware if desired log level was specifically requested by the user (--debugflag) or just the default (INFOlevel). As such, the newlog_initfunction takes into account all sources that decide what log level we should select: CLI options,RUST_LOGenv variable, and tedge configuration file.Types of changes
Paste Link to the issue
Checklist
cargo fmtas mentioned in CODING_GUIDELINEScargo clippyas mentioned in CODING_GUIDELINESFurther comments
To be merged before #3205