|
507
|
1 /*
|
|
|
2 * Geeqie
|
|
|
3 * Copyright (C) 2008 The Geeqie Team
|
|
|
4 *
|
|
|
5 * Authors: Vladimir Nadvornik, Laurent Monin
|
|
|
6 *
|
|
|
7 * This software is released under the GNU General Public License (GNU GPL).
|
|
|
8 * Please read the included file COPYING for more information.
|
|
|
9 * This software comes with no warranty of any kind, use at your own risk!
|
|
|
10 */
|
|
|
11
|
|
|
12 #include "main.h"
|
|
|
13 #include "debug.h"
|
|
|
14
|
|
|
15 #ifdef DEBUG
|
|
|
16
|
|
|
17 static gint debug_level = DEBUG_LEVEL_MIN;
|
|
|
18
|
|
|
19
|
|
|
20 gint get_debug_level(void)
|
|
|
21 {
|
|
|
22 return debug_level;
|
|
|
23 }
|
|
|
24
|
|
|
25 void set_debug_level(gint new_level)
|
|
|
26 {
|
|
|
27 debug_level = CLAMP(new_level, DEBUG_LEVEL_MIN, DEBUG_LEVEL_MAX);
|
|
|
28 }
|
|
|
29
|
|
|
30 void debug_level_add(gint delta)
|
|
|
31 {
|
|
|
32 set_debug_level(debug_level + delta);
|
|
|
33 }
|
|
|
34
|
|
|
35 gint required_debug_level(gint level)
|
|
|
36 {
|
|
|
37 return (debug_level >= level);
|
|
|
38 }
|
|
|
39
|
|
|
40 #endif
|