[glib] glib-init: restore default for G_MESSAGES_PREFIXED
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] glib-init: restore default for G_MESSAGES_PREFIXED
- Date: Wed, 14 Mar 2012 00:15:35 +0000 (UTC)
commit 545736c0fbc4fdc861a726b293a5b3c1cd611a3c
Author: Ryan Lortie <desrt desrt ca>
Date: Tue Mar 13 20:08:27 2012 -0400
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
glib/glib-init.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/glib/glib-init.c b/glib/glib-init.c
index a03e918..f4edd5c 100644
--- a/glib/glib-init.c
+++ b/glib/glib-init.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]