Ensure verbose flag in YAML sets logging to DEBUG mode correctly#84
Merged
harryswift01 merged 4 commits intomainfrom Apr 8, 2025
Merged
Ensure verbose flag in YAML sets logging to DEBUG mode correctly#84harryswift01 merged 4 commits intomainfrom
harryswift01 merged 4 commits intomainfrom
Conversation
- Updated `merge_configs` method to explicitly handle the `verbose` flag from YAML configuration - Added `update_logging_level` method to `LoggingConfig` class to update logging levels for all loggers and handlers - Modified `main` function to use the new method for updating logging levels - Ensured `DEBUG` level messages are directed to file handlers while console handler remains at `INFO` level - Updated the input YAML file template to make sure they correctly match up to the arguments in argsparse
jimboid
reviewed
Apr 7, 2025
jimboid
approved these changes
Apr 7, 2025
Member
jimboid
left a comment
There was a problem hiding this comment.
Looks like it has resolved the issue with logging levels being incorrectly set when done by yaml.
Looking at the config there are some mixed formatting on var names, but we can discuss this tomorrow without blocking this PR. Happy to merge.
- Updated `waterEntropy` to `water_entropy` - Updated `mout` to `matrix_out` - Updated `outfile` to `output_file` - Ensured that any instance of any of these arguments have been changed throughout the codebase to match - Updated some of the test cases so that they match the new arguments names and made sure they have the correct file format to maintain consistency
0fe837d to
0e4b6c0
Compare
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.
Summary
This PR addresses the issue where setting the
verboseflag to True in the YAML configuration does not set the logging system toDEBUGmode. The changes ensure that theverboseflag from the YAML input is correctly merged and applied, and thatDEBUGlevel messages are directed to file handlers while the console handler remains atINFOlevel.Changes
Updated
merge_configsmethod to explicitly handle theverboseflag from YAML configuration:verboseflag from the YAML configuration is correctly merged with CLI arguments.Added
update_logging_levelmethod toLoggingConfigclass to update logging levels for all loggers and handlersupdate_logging_levelto update the logging level for all loggers and handlers.DEBUGlevel messages are directed to file handlers while console handler remains atINFOlevel.Modified
mainfunction to use the new method for updating logging levelsmainfunction to initialize the logging system once and use theupdate_logging_levelmethod to set the logging level for each run configuration.Updated the input YAML file template to make sure they correctly match up to the arguments in argparse
Impact
DEBUGlevel messages are correctly logged to file handlers when verbose is set toTruein the YAML configuration.