[glib] g_log: mask log level before checking prefix flags



commit fbbdf98668641a6e6494dacb5f5f13703145e6f8
Author: Ryan Lortie <desrt desrt ca>
Date:   Tue Mar 13 20:10:39 2012 -0400

    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

 glib/gmessages.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/glib/gmessages.c b/glib/gmessages.c
index 7dafbf5..4230f08 100644
--- a/glib/gmessages.c
+++ b/glib/gmessages.c
@@ -1209,7 +1209,7 @@ g_log_default_handler (const gchar   *log_domain,
   if (!log_domain)
     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 ();
       



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]