From 1b146398383ce0829926232cf1598787946abbcb Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Mon, 4 Nov 2024 15:33:43 +0100 Subject: [PATCH] Use log levels when getting logs from GLib Do not ignore log levels from GLib when redirecting these logs to our logs. Related: RHEL-58834 --- pyanaconda/anaconda_logging.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyanaconda/anaconda_logging.py b/pyanaconda/anaconda_logging.py index eef3b66e2aa..b18af72a24c 100644 --- a/pyanaconda/anaconda_logging.py +++ b/pyanaconda/anaconda_logging.py @@ -252,6 +252,12 @@ def redirect_glib_logging_to_journal(self): # create functions that convert the messages coming # from GLib into something that fits to the anaconda logging format def log_adapter(domain, level, message, user_data): + if level in (LogLevelFlags.LEVEL_ERROR, + LogLevelFlags.LEVEL_CRITICAL): + self.anaconda_logger.error("GLib: %s", message) + elif level is LogLevelFlags.LEVEL_WARNING: + self.anaconda_logger.warning("GLib: %s", message) + self.anaconda_logger.debug("GLib: %s", message) def structured_log_adapter(level, fields, field_count, user_data):