glib-init: restore default for G_MESSAGES_PREFIXED

In the glib-init shuffle this ended up being set to no messages prefixed
by default.  Fix that so that we have prefixes back.

https://bugzilla.gnome.org/show_bug.cgi?id=672026
This commit is contained in:
Ryan Lortie 2012-03-13 20:08:27 -04:00
parent 063f03fa76
commit 545736c0fb

View File

@ -159,7 +159,8 @@ g_parse_debug_string (const gchar *string,
static guint
g_parse_debug_envvar (const gchar *envvar,
const GDebugKey *keys,
gint n_keys)
gint n_keys,
guint default_value)
{
const gchar *value;
@ -175,6 +176,9 @@ g_parse_debug_envvar (const gchar *envvar,
value = getenv (envvar);
#endif
if (value == NULL)
return default_value;
return g_parse_debug_string (value, keys, n_keys);
}
@ -190,7 +194,7 @@ g_messages_prefixed_init (void)
{ "debug", G_LOG_LEVEL_DEBUG }
};
g_log_msg_prefix = g_parse_debug_envvar ("G_MESSAGES_PREFIXED", keys, G_N_ELEMENTS (keys));
g_log_msg_prefix = g_parse_debug_envvar ("G_MESSAGES_PREFIXED", keys, G_N_ELEMENTS (keys), g_log_msg_prefix);
}
static void
@ -203,7 +207,7 @@ g_debug_init (void)
};
GLogLevelFlags flags;
flags = g_parse_debug_envvar ("G_DEBUG", keys, G_N_ELEMENTS (keys));
flags = g_parse_debug_envvar ("G_DEBUG", keys, G_N_ELEMENTS (keys), 0);
g_log_always_fatal |= flags & G_LOG_LEVEL_MASK;