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.
This commit is contained in:
Aleksander Morgado
2020-10-25 16:32:23 +01:00
parent ba1d3f944b
commit a31d762250

View File

@@ -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;