From fdfb28fc47cf6ec3e1ea61c1c5a50f38a0cb8262 Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Thu, 5 Dec 2019 00:37:13 +0100 Subject: [PATCH] Propagate log level to parent container --- restic_compose_backup/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/restic_compose_backup/cli.py b/restic_compose_backup/cli.py index 4700c9a..3283756 100644 --- a/restic_compose_backup/cli.py +++ b/restic_compose_backup/cli.py @@ -17,10 +17,14 @@ logger = logging.getLogger(__name__) def main(): """CLI entrypoint""" args = parse_args() - log.setup(level=args.log_level) config = Config() + log.setup(level=args.log_level or config.log_level) containers = RunningContainers() + # Ensure log level is propagated to parent container if overridden + if args.log_level: + containers.this_container.set_config_env('LOG_LEVEL', args.log_level) + if args.action == 'status': status(config, containers)