1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
3
* Copyright (C) 2007-2009 Richard Hughes <richard@hughsie.com>
5
* Licensed under the GNU General Public License Version 2
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34
* Non critical debugging
36
#define egg_debug(...) egg_debug_real (__func__, __FILE__, __LINE__, __VA_ARGS__)
43
#define egg_warning(...) egg_warning_real (__func__, __FILE__, __LINE__, __VA_ARGS__)
48
* Critical debugging, with exit
50
#define egg_error(...) egg_error_real (__func__, __FILE__, __LINE__, __VA_ARGS__)
52
#elif defined(__GNUC__) && __GNUC__ >= 3
53
#define egg_debug(...) egg_debug_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
54
#define egg_warning(...) egg_warning_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
55
#define egg_error(...) egg_error_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
57
#define egg_debug(...)
58
#define egg_warning(...)
59
#define egg_error(...)
62
gboolean egg_debug_init (gint *argc,
64
GOptionGroup *egg_debug_get_option_group (void);
65
gboolean egg_debug_is_verbose (void);
66
void egg_debug_backtrace (void);
67
void egg_debug_set_log_filename (const gchar *filename);
68
void egg_debug_real (const gchar *func,
71
const gchar *format, ...) __attribute__((format (printf,4,5)));
72
void egg_warning_real (const gchar *func,
75
const gchar *format, ...) __attribute__((format (printf,4,5)));
76
void egg_error_real (const gchar *func,
79
const gchar *format, ...) G_GNUC_NORETURN __attribute__((format (printf,4,5)));
83
#endif /* __EGG_DEBUG_H */