3 * This file is part of Evince
5 * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence
6 * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi
7 * Copyright (C) 2002 - 2005 Paolo Maggi
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330,
22 * Boston, MA 02111-1307, USA.
26 * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a
27 * list of people on the gedit Team.
28 * See the ChangeLog files for a list of changes.
30 * $Id: gedit-debug.c 4809 2006-04-08 14:46:31Z pborelli $
33 /* Modified by Evince Team */
43 #ifdef EV_ENABLE_DEBUG
44 static EvDebugSection ev_debug = EV_NO_DEBUG;
49 if (g_getenv ("EV_DEBUG") != NULL) {
50 /* enable all debugging */
51 ev_debug = ~EV_NO_DEBUG;
55 if (g_getenv ("EV_DEBUG_JOBS") != NULL)
56 ev_debug |= EV_DEBUG_JOBS;
60 ev_debug_message (EvDebugSection section,
63 const gchar *function,
64 const gchar *format, ...)
66 if (G_UNLIKELY (ev_debug & section)) {
72 va_start (args, format);
73 msg = g_strdup_vprintf (format, args);
77 g_print ("%s:%d (%s) %s\n", file, line, function, msg ? msg : "");
85 #endif /* EV_ENABLE_DEBUG */