Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
libnice
libnice
Commits
a7eaf5fe
Commit
a7eaf5fe
authored
Oct 09, 2008
by
Youness Alaoui
Browse files
Add support for NICE_DEBUG environment variable
parent
cb09f46c
Changes
3
Hide whitespace changes
Inline
Side-by-side
agent/agent.c
View file @
a7eaf5fe
...
...
@@ -346,6 +346,8 @@ nice_agent_class_init (NiceAgentClass *klass)
G_TYPE_UINT
,
G_TYPE_INVALID
);
/* Init debug options depending on env variables */
nice_debug_init
();
}
static
void
priv_generate_tie_breaker
(
NiceAgent
*
agent
)
...
...
agent/debug.c
View file @
a7eaf5fe
...
...
@@ -42,14 +42,46 @@
#include
"stunagent.h"
static
int
debug_enabled
=
1
;
static
int
debug_enabled
=
0
;
void
nice_debug_enable
(
gboolean
with_stun
)
{
#define NICE_DEBUG_STUN 1
#define NICE_DEBUG_NICE 2
static
const
GDebugKey
keys
[]
=
{
{
(
gchar
*
)
"stun"
,
NICE_DEBUG_STUN
},
{
(
gchar
*
)
"nice"
,
NICE_DEBUG_NICE
},
{
NULL
,
0
},
};
void
nice_debug_init
()
{
const
gchar
*
flags_string
;
guint
flags
;
flags_string
=
g_getenv
(
"NICE_DEBUG"
);
nice_debug_disable
(
TRUE
);
if
(
flags_string
!=
NULL
)
{
flags
=
g_parse_debug_string
(
flags_string
,
keys
,
2
);
if
(
flags
&
NICE_DEBUG_NICE
)
nice_debug_enable
(
FALSE
);
if
(
flags
&
NICE_DEBUG_STUN
)
stun_debug_enable
();
}
}
void
nice_debug_enable
(
gboolean
with_stun
)
{
debug_enabled
=
1
;
if
(
with_stun
)
stun_debug_enable
();
}
void
nice_debug_disable
(
gboolean
with_stun
)
{
void
nice_debug_disable
(
gboolean
with_stun
)
{
debug_enabled
=
0
;
if
(
with_stun
)
stun_debug_disable
();
...
...
agent/debug.h
View file @
a7eaf5fe
...
...
@@ -38,6 +38,7 @@
#include
<glib.h>
void
nice_debug_init
(
void
);
void
nice_debug_enable
(
gboolean
with_stun
);
void
nice_debug_disable
(
gboolean
with_stun
);
void
nice_debug
(
const
char
*
fmt
,
...);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment