Logging should be initialized first

This commit is contained in:
Matthias 2020-02-27 07:01:00 +01:00
parent 893d9cde8d
commit e5ec97495d

View File

@ -96,6 +96,8 @@ class Configuration:
# Keep a copy of the original configuration file # Keep a copy of the original configuration file
config['original_config'] = deepcopy(config) config['original_config'] = deepcopy(config)
self._process_logging_options(config)
self._process_runmode(config) self._process_runmode(config)
self._process_common_options(config) self._process_common_options(config)
@ -146,8 +148,6 @@ class Configuration:
def _process_common_options(self, config: Dict[str, Any]) -> None: def _process_common_options(self, config: Dict[str, Any]) -> None:
self._process_logging_options(config)
# Set strategy if not specified in config and or if it's non default # Set strategy if not specified in config and or if it's non default
if self.args.get("strategy") or not config.get('strategy'): if self.args.get("strategy") or not config.get('strategy'):
config.update({'strategy': self.args.get("strategy")}) config.update({'strategy': self.args.get("strategy")})
@ -379,7 +379,7 @@ class Configuration:
if not self.runmode: if not self.runmode:
# Handle real mode, infer dry/live from config # Handle real mode, infer dry/live from config
self.runmode = RunMode.DRY_RUN if config.get('dry_run', True) else RunMode.LIVE self.runmode = RunMode.DRY_RUN if config.get('dry_run', True) else RunMode.LIVE
logger.info(f"Runmode set to {self.runmode}.") logger.info(f"Runmode set to {self.runmode.value}.")
config.update({'runmode': self.runmode}) config.update({'runmode': self.runmode})