mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
g_log: mask log level before checking prefix flags
We check if the log level is in the "prefixed" list by checking it against the g_log_msg_prefix bitfield. Unfortunately we were failing to mask by G_LOG_LEVEL_MASK first, so if the FATAL bit was set (for example) then it would never match. This was the case for g_error(). https://bugzilla.gnome.org/show_bug.cgi?id=672026
This commit is contained in:
parent
545736c0fb
commit
fbbdf98668
@ -1209,7 +1209,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
if (!log_domain)
|
if (!log_domain)
|
||||||
g_string_append (gstring, "** ");
|
g_string_append (gstring, "** ");
|
||||||
|
|
||||||
if ((g_log_msg_prefix & log_level) == log_level)
|
if ((g_log_msg_prefix & (log_level & G_LOG_LEVEL_MASK)) == (log_level & G_LOG_LEVEL_MASK))
|
||||||
{
|
{
|
||||||
const gchar *prg_name = g_get_prgname ();
|
const gchar *prg_name = g_get_prgname ();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user