27
26
TP_DEBUG_HANDLES = 1 << 10,
28
27
TP_DEBUG_CONTACTS = 1 << 11,
29
28
TP_DEBUG_ACCOUNTS = 1 << 12,
30
TP_DEBUG_DISPATCHER = 1 << 13
29
TP_DEBUG_DISPATCHER = 1 << 13,
30
TP_DEBUG_CLIENT = 1 << 14
33
33
gboolean _tp_debug_flag_is_set (TpDebugFlags flag);
34
34
void _tp_debug_set_flags (TpDebugFlags flags);
35
void _tp_debug (TpDebugFlags flag, const gchar *format, ...)
35
void _tp_log (GLogLevelFlags level, TpDebugFlags flag, const gchar *format, ...)
37
37
gboolean _tp_debug_is_persistent (void);
39
39
#define _TP_DEBUG_IS_PERSISTENT (_tp_debug_is_persistent ())
45
#define _TP_DEBUG_IS_PERSISTENT (0)
47
#endif /* ENABLE_DEBUG */
49
43
#endif /* __DEBUG_H__ */
51
45
/* ------------------------------------ */
66
#define ERROR(format, ...) \
69
_tp_log (G_LOG_LEVEL_ERROR, DEBUG_FLAG, "%s: " format, \
70
G_STRFUNC, ##__VA_ARGS__); \
71
g_assert_not_reached (); \
76
#define CRITICAL(format, ...) \
77
_tp_log (G_LOG_LEVEL_CRITICAL, DEBUG_FLAG, "%s: " format, \
78
G_STRFUNC, ##__VA_ARGS__)
80
#define WARNING(format, ...) \
81
_tp_log (G_LOG_LEVEL_WARNING, DEBUG_FLAG, "%s: " format, \
82
G_STRFUNC, ##__VA_ARGS__)
84
#define MESSAGE(format, ...) \
85
_tp_log (G_LOG_LEVEL_MESSAGE, DEBUG_FLAG, "%s: " format, \
86
G_STRFUNC, ##__VA_ARGS__)
88
#define INFO(format, ...) \
89
_tp_log (G_LOG_LEVEL_INFO, DEBUG_FLAG, "%s: " format, \
90
G_STRFUNC, ##__VA_ARGS__)
73
#define DEBUG(format, ...) \
74
_tp_debug (DEBUG_FLAG, "%s: " format, G_STRFUNC, ##__VA_ARGS__)
77
#define DEBUGGING _tp_debug_flag_is_set (DEBUG_FLAG)
96
# define DEBUG(format, ...) \
97
_tp_log (G_LOG_LEVEL_DEBUG, DEBUG_FLAG, "%s: " format, \
98
G_STRFUNC, ##__VA_ARGS__)
99
# define DEBUGGING _tp_debug_flag_is_set (DEBUG_FLAG)
79
100
#else /* !defined (ENABLE_DEBUG) */
82
#define DEBUG(format, ...) do {} while (0)
101
# define DEBUG(format, ...) do {} while (0)
87
103
#endif /* !defined (ENABLE_DEBUG) */
88
105
#endif /* defined (DEBUG_FLAG) */