From 0884a0c162af28ac71f5d1cdf6878349b0f6ffc1 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 1 Mar 2021 18:06:43 +0100 Subject: [PATCH] Further simplify logging configuration by using the 'cli' handler when running yunohost-api in debug mode instead of creating a 'console' handler which is pretty much the same --- src/yunohost/__init__.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/yunohost/__init__.py b/src/yunohost/__init__.py index 04b2115b2..04caefc7a 100644 --- a/src/yunohost/__init__.py +++ b/src/yunohost/__init__.py @@ -154,14 +154,8 @@ def init_logging(interface="cli", debug=False, quiet=False, logdir="/var/log/yun # This is for when launching yunohost-api in debug mode, we want to display stuff in the console if debug: - logging_configuration["handlers"]["console"] = { - 'class': 'logging.StreamHandler', - 'formatter': 'console', - 'stream': 'ext://sys.stdout', - 'filters': ['action'], - }, - logging_configuration["loggers"]["yunohost"]["handlers"].append("console") - logging_configuration["loggers"]["moulinette"]["handlers"].append("console") - logging_configuration["root"]["handlers"].append("console") + logging_configuration["loggers"]["yunohost"]["handlers"].append("cli") + logging_configuration["loggers"]["moulinette"]["handlers"].append("cli") + logging_configuration["root"]["handlers"].append("cli") configure_logging(logging_configuration)