search: Use G_REGEX_MULTILINE for find in files.
[anjuta.git] / libanjuta / anjuta-debug.h
blob6292c9c04976066d916f970082c5011a2537708f
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 anjuta-debug.h
4 Copyright (C) 2003 Naba Kumar <naba@gnome.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 /**
22 * SECTION:anjuta-debug
23 * @title: Debugging
24 * @short_description: Debug functions
25 * @see_also:
26 * @stability: Unstable
27 * @include: libanjuta/anjuta-debug.h
29 * Anjuta debug messages displayed with g_debug() can be filtered based on their
30 * domain. By default if DEBUG is defiled, all message are displayed. If DEBUG is not
31 * defined, all messages are hidden.
33 * This behavior can be changed using the ANJUTA_LOG_DOMAINS environment
34 * variable. If this variable is set to "all", all message are displayed whatever is the
35 * value of DEBUG. Else you can set it to a list of domains separated by space to
36 * display messages from these selected domains only.
37 * If G_LOG_DOMAIN is undefined, it will match a domain named "NULL".
39 * By example
40 *<programlisting>
41 * ANJUTA_LOG_DOMAINS=Gtk Anjuta libanjuta-gdb
42 *</programlisting>
43 * will display debug messages from Gtk, Anjuta and gdb plugin only.
46 #ifndef __ANJUTA_DEBUG__
47 #define __ANJUTA_DEBUG__
49 /**
50 * DEBUG_PRINT:
52 * Equivalent to g_debug() showing the FILE, the LINE and the FUNC,
53 * except it has only effect when DEBUG is defined. Used for printing debug
54 * messages.
56 #if defined (DEBUG)
57 #if defined (__GNUC__) && (__GNUC__ >= 3) && !defined(__STRICT_ANSI__)
58 #define DEBUG_PRINT(format, ...) g_debug ("%s:%d (%s) " format, __FILE__, __LINE__, G_STRFUNC, ##__VA_ARGS__)
59 #else
60 #define DEBUG_PRINT g_debug
61 #endif
62 #else
63 #define DEBUG_PRINT(...)
64 #endif
66 void anjuta_debug_init (void);
68 #endif /* _ANJUTA_DEBUG_H_ */