Skip to content

Commit

Permalink
Use log levels when getting logs from GLib
Browse files Browse the repository at this point in the history
Do not ignore log levels from GLib when redirecting these logs to our
logs.

Related: RHEL-58834
  • Loading branch information
jkonecny12 committed Nov 4, 2024
1 parent a3e1fc1 commit b5d259c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pyanaconda/anaconda_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit b5d259c

Please sign in to comment.