From 045455648a34a113e73ee9056466b5e5047a0f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Fri, 24 Jun 2022 13:17:20 +0200 Subject: [PATCH] klippy: properly set log level when logging to stderr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `logging.basicConfig` does not reconfigure default logger. This results in printing only warnings/errors to stderr instead of also info (or debug). This fixes the issue by setting log level on root logger. Signed-off-by: Kamil TrzciƄski --- klippy/klippy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/klippy/klippy.py b/klippy/klippy.py index d7b62453..dbd3cd37 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -342,7 +342,7 @@ def main(): start_args['log_file'] = options.logfile bglogger = queuelogger.setup_bg_logging(options.logfile, debuglevel) else: - logging.basicConfig(level=debuglevel) + logging.getLogger().setLevel(debuglevel) logging.info("Starting Klippy...") start_args['software_version'] = util.get_git_version() start_args['cpu_info'] = util.get_cpu_info()