Merge branch 'harmonize-would_drop' into 'main'

Harmonize would_drop() replacement for g_log_writer_default_would_drop()

See merge request GNOME/gtk!4935
This commit is contained in:
Matthias Clasen 2023-04-28 22:55:42 +00:00
commit 63b50f48a9
2 changed files with 5 additions and 1 deletions

View File

@ -507,7 +507,7 @@ log_writer (GLogLevelFlags log_level,
}
#endif
if (!would_drop (log_level, NULL))
if (!would_drop (log_level, NULL))
return g_log_writer_standard_streams (log_level, fields, n_fields, user_data);
return G_LOG_WRITER_HANDLED;

View File

@ -55,9 +55,13 @@ static gboolean
would_drop (GLogLevelFlags level,
const char *domain)
{
#if GLIB_CHECK_VERSION (2, 68, 0)
return g_log_writer_default_would_drop (level, domain);
#else
return (level & (G_LOG_LEVEL_ERROR |
G_LOG_LEVEL_CRITICAL |
G_LOG_LEVEL_WARNING)) == 0;
#endif
}
static GLogWriterOutput