mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 13:06:14 +01:00
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:
parent
063f03fa76
commit
545736c0fb
@ -159,7 +159,8 @@ g_parse_debug_string (const gchar *string,
|
|||||||
static guint
|
static guint
|
||||||
g_parse_debug_envvar (const gchar *envvar,
|
g_parse_debug_envvar (const gchar *envvar,
|
||||||
const GDebugKey *keys,
|
const GDebugKey *keys,
|
||||||
gint n_keys)
|
gint n_keys,
|
||||||
|
guint default_value)
|
||||||
{
|
{
|
||||||
const gchar *value;
|
const gchar *value;
|
||||||
|
|
||||||
@ -175,6 +176,9 @@ g_parse_debug_envvar (const gchar *envvar,
|
|||||||
value = getenv (envvar);
|
value = getenv (envvar);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (value == NULL)
|
||||||
|
return default_value;
|
||||||
|
|
||||||
return g_parse_debug_string (value, keys, n_keys);
|
return g_parse_debug_string (value, keys, n_keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +194,7 @@ g_messages_prefixed_init (void)
|
|||||||
{ "debug", G_LOG_LEVEL_DEBUG }
|
{ "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
|
static void
|
||||||
@ -203,7 +207,7 @@ g_debug_init (void)
|
|||||||
};
|
};
|
||||||
GLogLevelFlags flags;
|
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;
|
g_log_always_fatal |= flags & G_LOG_LEVEL_MASK;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user