Propagate log level to parent container

This commit is contained in:
Einar Forselv 2019-12-05 00:37:13 +01:00
parent 1978ee5946
commit fdfb28fc47
1 changed files with 5 additions and 1 deletions

View File

@ -17,10 +17,14 @@ logger = logging.getLogger(__name__)
def main(): def main():
"""CLI entrypoint""" """CLI entrypoint"""
args = parse_args() args = parse_args()
log.setup(level=args.log_level)
config = Config() config = Config()
log.setup(level=args.log_level or config.log_level)
containers = RunningContainers() 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': if args.action == 'status':
status(config, containers) status(config, containers)