From abadff31d8c95fc5019cea0609a9a7e5463ff47c Mon Sep 17 00:00:00 2001 From: Hazel Noack Date: Wed, 30 Jul 2025 11:55:33 +0200 Subject: [PATCH] imporved logging --- python_mommy_venv/__main__.py | 1 + python_mommy_venv/responses.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/python_mommy_venv/__main__.py b/python_mommy_venv/__main__.py index cc356e1..8b25aa0 100644 --- a/python_mommy_venv/__main__.py +++ b/python_mommy_venv/__main__.py @@ -171,6 +171,7 @@ def cli_compile_config(): args = parser.parse_args() + config_logging(args.verbose) write_compile_config(args.local) diff --git a/python_mommy_venv/responses.py b/python_mommy_venv/responses.py index 48b463d..d6638d4 100644 --- a/python_mommy_venv/responses.py +++ b/python_mommy_venv/responses.py @@ -25,7 +25,7 @@ ADDITIONAL_ENV_VARS = { -def _load_config_file(config_file: Path) -> Dict[str, List[str]]: +def _load_config_file(config_file: Path) -> dict: with config_file.open("r") as f: data = toml.load(f) @@ -95,7 +95,15 @@ def compile_config(disable_requests: bool = False) -> dict: # load config file config_file = get_config_file() if config_file is not None: - config.update(_load_config_file(config_file)) + c = _load_config_file(config_file) + serious_logger.debug( + "config at %s:\n%s\n", + config_file, + json.dumps(c, indent=4) + ) + + config["mood"] = c.get("moods", config["mood"]) + config.update(c.get("vars", {})) # fill config with env for key, conf in config_definition.items():