[elbe-devel] [PATCH 01/18] elbepack: log: only reconfigure root logger when elbe logging is active

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Aug 13 13:15:31 CEST 2024


The global log level of DEBUG is only useful in the initvm for the
custom logforwarding logic.
Some future changes will lead to elbepack.log also being imported in the
elbe client which would otherwise print a flood of DEBUG logs from the
suds library.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/log.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elbepack/log.py b/elbepack/log.py
index b219fd9008fc..7823b3d08199 100644
--- a/elbepack/log.py
+++ b/elbepack/log.py
@@ -12,7 +12,6 @@ from contextlib import contextmanager
 
 
 root = logging.getLogger()
-root.setLevel(logging.DEBUG)
 local = threading.local()
 context_fmt = logging.Formatter('%(context)s%(message)s')
 msgonly_fmt = logging.Formatter('%(message)s')
@@ -150,6 +149,7 @@ def elbe_logging(*args, **kwargs):
 def open_logging(**targets):
 
     close_logging()
+    root.setLevel(logging.DEBUG)
 
     for key, call in _logging_methods.items():
         if key in targets:

-- 
2.46.0



More information about the elbe-devel mailing list