Ensure verbose flag in YAML sets logging to DEBUG mode correctly #84
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.