aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-10-25 16:32:23 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-10-25 21:38:01 +0100
commita31d762250edba7bbad34adec051d9cff0279f66 (patch)
tree939375394c409d32648cb8f91b2d14901b8772b3 /src
parentba1d3f944b2a90bf75f0a5e6232dfe6cb34a8eb9 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/mm-log.c5
1 files changed, 5 insertions, 0 deletions
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;