1 /* libmpd (high level libmpdclient library)
2 * Copyright (C) 2004-2009 Qball Cow <qball@sarine.nl>
3 * Project homepage: http://gmpcwiki.sarine.nl/
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef __DEBUG_PRINTF_H__
21 #define __DEBUG_PRINTF_H__
23 /**\defgroup 100debug Debug
29 typedef enum _DebugLevel
{
30 /** No debug output */
32 /** Print only error messages */
34 /** Print Error and Warning messages */
36 /** Print only error message */
41 * @param dl a #DebugLevel
43 * Set the debug level. if set to DEBUG_INFO everything is printed to stdout.
45 void debug_set_level(DebugLevel dl
);
47 /** Internal function, do no use */
48 void debug_printf_real(DebugLevel dp
, const char *file
,const int line
,const char *function
, const char *format
,...);
51 * @param dp The debug level the message is at.
52 * @param format a printf style string
53 * @param ARGS arguments for format
55 #define debug_printf(dp, format, ARGS...) debug_printf_real(dp,__FILE__,__LINE__,__FUNCTION__,format,##ARGS)
60 * Redirect the output from stdout to fp.
61 * Set to NULL, to revert back to stdout.
63 void debug_set_output(FILE *fp
);