File: xapp-debug.h

package info (click to toggle)
xapp 2.8.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,724 kB
  • sloc: ansic: 11,268; python: 1,463; xml: 258; sh: 22; makefile: 9
file content (82 lines) | stat: -rw-r--r-- 2,225 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * xapp-debug: debug loggers for xapp
 *
 * Copyright (C) 2007 Collabora Ltd.
 * Copyright (C) 2007 Nokia Corporation
 * Copyright (C) 2010 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * Copied from nemo
 */

#ifndef __XAPP_DEBUG_H__
#define __XAPP_DEBUG_H__

#include <config.h>
#include <glib.h>

G_BEGIN_DECLS

#ifdef ENABLE_DEBUG

typedef enum
{
  XAPP_DEBUG_WINDOW = 1 << 1,
  XAPP_DEBUG_FAVORITES = 1 << 2,
  XAPP_DEBUG_FAVORITE_VFS = 1 << 3,
  XAPP_DEBUG_STATUS_ICON = 1 << 4,
  XAPP_DEBUG_SN_WATCHER = 1 << 5,
  XAPP_DEBUG_MODULE = 1 << 6,
  XAPP_DEBUG_VISIBILITY_GROUP = 1 << 7,
  XAPP_DEBUG_GPU_OFFLOAD = 1 << 8,
  XAPP_DEBUG_DARK_MODE_MANAGER = 1 << 9
} DebugFlags;

void xapp_debug_set_flags (DebugFlags flags);
gboolean xapp_debug_flag_is_set (DebugFlags flag);
const gchar *debug_flag_to_string (DebugFlags flag);

void xapp_debug_valist (DebugFlags flag,
                            const gchar *format, va_list args);

void xapp_debug (DebugFlags flag, const gchar *format, ...)
  G_GNUC_PRINTF (2, 3);

#ifdef DEBUG_FLAG

#define DEBUG(format, ...) \
  xapp_debug (DEBUG_FLAG, "(%s) %s: %s: " format, debug_flag_to_string (DEBUG_FLAG), G_STRFUNC, G_STRLOC, \
                  ##__VA_ARGS__)

#define DEBUGGING xapp_debug_flag_is_set(DEBUG_FLAG)

#endif /* DEBUG_FLAG */

#else /* ENABLE_DEBUG */

#ifdef DEBUG_FLAG

#define DEBUG(format, ...) \
  G_STMT_START { } G_STMT_END

#define DEBUGGING 0

#endif /* DEBUG_FLAG */
#endif /* ENABLE_DEBUG */

G_END_DECLS

#endif /* __XAPP_DEBUG_H__ */