Changed EphyHistoryWindow to use the new backend, some things still remain (selected_...
[ephy-soc.git] / lib / ephy-debug.h
blobcc0a61eedc74e3db75f9585c2e94c4b77f6dd731
1 /*
2 * Copyright © 2003 Marco Pesenti Gritti
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
7 * any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * $Id: ephy-debug.h 6952 2007-03-11 19:42:02Z chpe $
21 #ifndef EPHY_DEBUG_H
22 #define EPHY_DEBUG_H
24 #include <glib.h>
26 G_BEGIN_DECLS
28 #ifndef GNOME_ENABLE_DEBUG
29 #define DISABLE_LOGGING
30 #define DISABLE_PROFILING
31 #endif
33 #if defined(G_HAVE_GNUC_VARARGS)
35 #ifdef DISABLE_LOGGING
36 #define LOG(msg, args...) G_STMT_START { } G_STMT_END
37 #else
38 #define LOG(msg, args...) \
39 g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
40 "[ %s ] " msg, \
41 __FILE__ , ## args)
42 #endif
44 #elif defined(G_HAVE_ISO_VARARGS)
46 #define LOG(...) G_STMT_START { } G_STMT_END
48 #else /* no varargs macros */
50 static void LOG(const char *format, ...) {}
52 #endif
54 #ifdef DISABLE_PROFILING
55 #define START_PROFILER(name)
56 #define STOP_PROFILER(name)
57 #else
58 #define START_PROFILER(name) \
59 ephy_profiler_start (name, __FILE__);
60 #define STOP_PROFILER(name) \
61 ephy_profiler_stop (name);
62 #endif
64 typedef struct
66 GTimer *timer;
67 char *name;
68 char *module;
69 } EphyProfiler;
71 void ephy_debug_init (void);
73 #ifndef DISABLE_PROFILING
75 void ephy_profiler_start (const char *name,
76 const char *module);
78 void ephy_profiler_stop (const char *name);
80 #endif
82 G_END_DECLS
84 #endif