From a31d762250edba7bbad34adec051d9cff0279f66 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sun, 25 Oct 2020 16:32:23 +0100 Subject: [PATCH] log: ignore fatal flag for logging purposes Running with G_DEBUG=fatal-warnings will end up reporting warning logs with G_LOG_FLAG_FATAL, which breaks our own logging logic. --- src/mm-log.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mm-log.c b/src/mm-log.c index 658e0c12..8945b891 100644 --- a/src/mm-log.c +++ b/src/mm-log.c @@ -100,6 +100,11 @@ mm_to_syslog_priority (MMLogLevel level) static int glib_to_syslog_priority (GLogLevelFlags level) { + /* if the log was flagged as fatal (e.g. G_DEBUG=fatal-warnings), ignore + * the fatal flag for logging purposes */ + if (level & G_LOG_FLAG_FATAL) + level &= ~G_LOG_FLAG_FATAL; + switch (level) { case G_LOG_LEVEL_ERROR: return LOG_CRIT;