Commit 47e6a9b9 authored by Youness Alaoui's avatar Youness Alaoui

Allow nice_debug_enable and nice_debug_disable to be called before the first...

Allow nice_debug_enable and nice_debug_disable to be called before the first NiceAgent is instanciated
parent 69888aa8
......@@ -61,9 +61,13 @@ static const GDebugKey keys[] = {
void nice_debug_init ()
{
static gboolean debug_initialized = FALSE;
const gchar *flags_string;
guint flags;
if (!debug_initialized) {
debug_initialized = TRUE;
flags_string = g_getenv ("NICE_DEBUG");
nice_debug_disable (TRUE);
......@@ -83,18 +87,20 @@ void nice_debug_init ()
pseudo_tcp_set_debug_level (PSEUDO_TCP_DEBUG_VERBOSE);
if (flags & NICE_DEBUG_PSEUDOTCP)
pseudo_tcp_set_debug_level (PSEUDO_TCP_DEBUG_NORMAL);
}
}
}
void nice_debug_enable (gboolean with_stun)
{
nice_debug_init ();
debug_enabled = 1;
if (with_stun)
stun_debug_enable ();
}
void nice_debug_disable (gboolean with_stun)
{
nice_debug_init ();
debug_enabled = 0;
if (with_stun)
stun_debug_disable ();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment