3 #include "json-debug.h"
5 static unsigned int json_debug_flags = 0;
7 #ifdef JSON_ENABLE_DEBUG
8 static const GDebugKey json_debug_keys[] = {
9 { "parser", JSON_DEBUG_PARSER },
10 { "gobject", JSON_DEBUG_GOBJECT },
11 { "path", JSON_DEBUG_PATH }
13 #endif /* JSON_ENABLE_DEBUG */
16 json_get_debug_flags (void)
18 #ifdef JSON_ENABLE_DEBUG
19 static gboolean json_debug_flags_set;
22 if (G_LIKELY (json_debug_flags_set))
23 return json_debug_flags;
25 env_str = g_getenv ("JSON_DEBUG");
26 if (env_str != NULL && *env_str != '\0')
28 json_debug_flags |= g_parse_debug_string (env_str,
30 G_N_ELEMENTS (json_debug_keys));
33 json_debug_flags_set = TRUE;
34 #endif /* JSON_ENABLE_DEBUG */
36 return json_debug_flags;