2 * (GLABELS) Label and Business Card Creation program for GNOME
4 * debug.c: GLabels debug module
6 * Copyright (C) 2001-2002 Jim Evins <evins@snaught.com>.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * This file is based on gedit-debug.c from gedit2:
26 * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence
27 * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi
34 /* External debug options, used here and in glabels.c */
35 gint gl_debug_all = 0;
36 gint gl_debug_view = 0;
37 gint gl_debug_item = 0;
38 gint gl_debug_prefs = 0;
39 gint gl_debug_print = 0;
40 gint gl_debug_file = 0;
41 gint gl_debug_label = 0;
42 gint gl_debug_template = 0;
43 gint gl_debug_paper = 0;
44 gint gl_debug_xml = 0;
45 gint gl_debug_merge = 0;
46 gint gl_debug_commands = 0;
47 gint gl_debug_undo = 0;
48 gint gl_debug_recent = 0;
49 gint gl_debug_window = 0;
51 gint gl_debug_property_bar = 0;
52 gint gl_debug_media_select = 0;
53 gint gl_debug_mini_preview = 0;
54 gint gl_debug_pixbuf_cache = 0;
55 gint gl_debug_wdgt = 0;
57 /****************************************************************************/
58 /* Print debugging information. */
59 /****************************************************************************/
61 gl_debug (gint section,
71 g_return_if_fail (format != NULL);
73 va_start (args, format);
74 msg = g_strdup_vprintf (format, args);
78 (gl_debug_view && section == GL_DEBUG_VIEW) ||
79 (gl_debug_item && section == GL_DEBUG_ITEM) ||
80 (gl_debug_print && section == GL_DEBUG_PRINT) ||
81 (gl_debug_prefs && section == GL_DEBUG_PREFS) ||
82 (gl_debug_file && section == GL_DEBUG_FILE) ||
83 (gl_debug_label && section == GL_DEBUG_LABEL) ||
84 (gl_debug_template && section == GL_DEBUG_TEMPLATE) ||
85 (gl_debug_paper && section == GL_DEBUG_PAPER) ||
86 (gl_debug_xml && section == GL_DEBUG_XML) ||
87 (gl_debug_merge && section == GL_DEBUG_MERGE) ||
88 (gl_debug_commands && section == GL_DEBUG_COMMANDS) ||
89 (gl_debug_undo && section == GL_DEBUG_UNDO) ||
90 (gl_debug_recent && section == GL_DEBUG_RECENT) ||
91 (gl_debug_window && section == GL_DEBUG_WINDOW) ||
92 (gl_debug_ui && section == GL_DEBUG_UI) ||
93 (gl_debug_property_bar && section == GL_DEBUG_PROPERTY_BAR) ||
94 (gl_debug_media_select && section == GL_DEBUG_MEDIA_SELECT) ||
95 (gl_debug_mini_preview && section == GL_DEBUG_MINI_PREVIEW) ||
96 (gl_debug_pixbuf_cache && section == GL_DEBUG_PIXBUF_CACHE) ||
97 (gl_debug_wdgt && section == GL_DEBUG_WDGT) )
98 g_print ("%s:%d (%s) %s\n", file, line, function, msg);