2 * Copyright (C) 2007 Nokia Corporation
3 * Copyright (C) 2007-2011 Collabora Ltd.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 /* Please keep this enum in sync with #keys in gck-debug.c */
31 GCK_DEBUG_SESSION = 1 << 1,
32 GCK_DEBUG_ENUMERATOR = 1 << 2,
35 gboolean _gck_debug_flag_is_set (GckDebugFlags flag);
37 void _gck_debug_set_flags (const gchar *flags_string);
39 void _gck_debug_message (GckDebugFlags flag,
41 ...) G_GNUC_PRINTF (2, 3);
43 void _gck_debug_init (void);
47 #endif /* GCK_DEBUG_H */
49 /* -----------------------------------------------------------------------------
50 * Below this point is outside the GCK_DEBUG_H guard - so it can take effect
51 * more than once. So you can do:
53 * #define DEBUG_FLAG GCK_DEBUG_ONE_THING
54 * #include "gck-debug.h"
56 * DEBUG ("if we're debugging one thing");
59 * #define DEBUG_FLAG GCK_DEBUG_OTHER_THING
60 * #include "gck-debug.h"
62 * DEBUG ("if we're debugging the other thing");
70 #define _gck_debug(format, ...) \
71 _gck_debug_message (DEBUG_FLAG, "%s: " format, G_STRFUNC, ##__VA_ARGS__)
74 #define _gck_debugging \
75 _gck_debug_flag_is_set (DEBUG_FLAG)
77 #else /* !defined (WITH_DEBUG) */
80 #define _gck_debug(format, ...) \
84 #define _gck_debugging 0
86 #endif /* !defined (WITH_DEBUG) */
88 #endif /* defined (DEBUG_FLAG) */