Coverage Report

Created: 2026-01-09 07:08

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/tinysparql/subprojects/json-glib-1.10.6/json-glib/json-debug.c
Line
Count
Source
1
/* json-debug.c: Logging utilities
2
 *
3
 * This file is part of JSON-GLib.
4
 *
5
 * SPDX-FileCopyrightText: 2010 Emmanuele Bassi
6
 * SPDX-License-Identifier: LGPL-2.1-or-later
7
 */
8
9
#include "config.h"
10
11
#include "json-debug.h"
12
13
static unsigned int json_debug_flags = 0;
14
15
#ifdef JSON_ENABLE_DEBUG
16
static const GDebugKey json_debug_keys[] = {
17
  { "parser", JSON_DEBUG_PARSER },
18
  { "gobject", JSON_DEBUG_GOBJECT },
19
  { "path", JSON_DEBUG_PATH },
20
  { "node", JSON_DEBUG_NODE },
21
};
22
#endif /* JSON_ENABLE_DEBUG */
23
24
JsonDebugFlags
25
json_get_debug_flags (void)
26
6.67M
{
27
6.67M
#ifdef JSON_ENABLE_DEBUG
28
6.67M
  static gboolean json_debug_flags_set;
29
6.67M
  const gchar *env_str;
30
31
6.67M
  if (G_LIKELY (json_debug_flags_set))
32
6.67M
    return json_debug_flags;
33
34
1
  env_str = g_getenv ("JSON_DEBUG");
35
1
  if (env_str != NULL && *env_str != '\0')
36
0
    {
37
0
      json_debug_flags |= g_parse_debug_string (env_str,
38
0
                                                json_debug_keys,
39
0
                                                G_N_ELEMENTS (json_debug_keys));
40
0
    }
41
42
1
  json_debug_flags_set = TRUE;
43
1
#endif /* JSON_ENABLE_DEBUG */
44
45
1
  return json_debug_flags;
46
6.67M
}