2 * Copyright (C) 2008 - 2016 The Geeqie Team
4 * Authors: Vladimir Nadvornik, Laurent Monin
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #define DOMAIN_DEBUG "debug"
27 #define DOMAIN_INFO "info"
29 void log_domain_printf(const gchar *domain, const gchar *format, ...) G_GNUC_PRINTF(2, 3);
30 void log_domain_print_debug(const gchar *domain, const gchar *file_name,
31 int line_number, const gchar *format, ...) G_GNUC_PRINTF(4, 5);
32 #define log_printf(...) log_domain_printf(DOMAIN_INFO, __VA_ARGS__)
36 #define DEBUG_LEVEL_MIN 0
37 #define DEBUG_LEVEL_MAX 4
39 void set_regexp(gchar *regexp);
40 gchar *get_regexp(void);
41 gint get_debug_level(void);
42 void set_debug_level(gint new_level);
43 void debug_level_add(gint delta);
44 gint required_debug_level(gint level);
45 const gchar *get_exec_time(void);
46 void init_exec_time(void);
48 #define DEBUG_N(n, ...) do \
50 gint debug_level = get_debug_level(); \
51 if (debug_level >= (n)) \
53 if (debug_level != 1) \
55 log_domain_print_debug(DOMAIN_DEBUG, __FILE__, __LINE__, __VA_ARGS__); \
59 log_domain_printf(DOMAIN_DEBUG, __VA_ARGS__); \
66 #define get_regexp() (0)
67 #define set_regexp(regexp) do { } while(0)
68 #define get_debug_level() (0)
69 #define set_debug_level(new_level) do { } while(0)
70 #define debug_level_add(delta) do { } while(0)
71 #define required_debug_level(level) (0)
72 #define get_exec_time() ""
73 #define init_exec_time() do { } while(0)
75 #define DEBUG_N(n, ...) do { } while(0)
79 #define DEBUG_0(...) DEBUG_N(0, __VA_ARGS__)
80 #define DEBUG_1(...) DEBUG_N(1, __VA_ARGS__)
81 #define DEBUG_2(...) DEBUG_N(2, __VA_ARGS__)
82 #define DEBUG_3(...) DEBUG_N(3, __VA_ARGS__)
83 #define DEBUG_4(...) DEBUG_N(4, __VA_ARGS__)
87 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */