1 /*****************************************************************************
2 * This file is part of gfxprim library. *
4 * Gfxprim is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU Lesser General Public *
6 * License as published by the Free Software Foundation; either *
7 * version 2.1 of the License, or (at your option) any later version. *
9 * Gfxprim 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 GNU *
12 * Lesser General Public License for more details. *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with gfxprim; if not, write to the Free Software *
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
17 * Boston, MA 02110-1301 USA *
19 * Copyright (C) 2009-2012 Cyril Hrubis <metan@ucw.cz> *
21 *****************************************************************************/
25 Debug messages and debug level. Debug level is an unsigned integer.
27 Messages with debug level 0 are always printed (you should generally avoid
28 using them unless you wan't user to see the message.)
30 Debug level 1 should be used on object initalization and generally rare and
33 Debug level > 1 is intended for more verbose reporting, like inner cycles
36 Debug levels with negative level are special. Debug level -1 means TODO,
37 level -2 says WARNING while -2 means BUG (i.e. library get into unconsistent
50 #define GP_DEFAULT_DEBUG_LEVEL 0
52 #define GP_DEBUG(level, ...) \
53 GP_DebugPrint(level, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
55 #define GP_TODO(...) \
56 GP_DebugPrint(-1, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
58 #define GP_WARN(...) \
59 GP_DebugPrint(-2, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
62 GP_DebugPrint(-3, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
64 void GP_SetDebugLevel(unsigned int level
);
66 unsigned int GP_GetDebugLevel(void);
68 void GP_DebugPrint(int level
, const char *file
, const char *function
, int line
,
69 const char *fmt
, ...) __attribute__ ((format (printf
, 5, 6)));
71 #endif /* GP_DEBUG_H */