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_xml = 0;
44 gint gl_debug_merge = 0;
45 gint gl_debug_commands = 0;
46 gint gl_debug_undo = 0;
47 gint gl_debug_recent = 0;
48 gint gl_debug_mdi = 0;
49 gint gl_debug_media_select = 0;
50 gint gl_debug_mini_preview = 0;
51 gint gl_debug_wdgt = 0;
53 /****************************************************************************/
54 /* Print debugging information. */
55 /****************************************************************************/
57 gl_debug (gint section,
67 g_return_if_fail (format != NULL);
69 va_start (args, format);
70 msg = g_strdup_vprintf (format, args);
74 (gl_debug_view && section == GL_DEBUG_VIEW) ||
75 (gl_debug_item && section == GL_DEBUG_ITEM) ||
76 (gl_debug_print && section == GL_DEBUG_PRINT) ||
77 (gl_debug_prefs && section == GL_DEBUG_PREFS) ||
78 (gl_debug_file && section == GL_DEBUG_FILE) ||
79 (gl_debug_label && section == GL_DEBUG_LABEL) ||
80 (gl_debug_template && section == GL_DEBUG_TEMPLATE) ||
81 (gl_debug_xml && section == GL_DEBUG_XML) ||
82 (gl_debug_merge && section == GL_DEBUG_MERGE) ||
83 (gl_debug_commands && section == GL_DEBUG_COMMANDS) ||
84 (gl_debug_undo && section == GL_DEBUG_UNDO) ||
85 (gl_debug_recent && section == GL_DEBUG_RECENT) ||
86 (gl_debug_mdi && section == GL_DEBUG_MDI) ||
87 (gl_debug_media_select && section == GL_DEBUG_MEDIA_SELECT) ||
88 (gl_debug_mini_preview && section == GL_DEBUG_MINI_PREVIEW) ||
89 (gl_debug_wdgt && section == GL_DEBUG_WDGT) )
90 g_print ("%s:%d (%s) %s\n", file, line, function, msg);