Adding some support for using "idle" to get changed events.
[libmpd.git] / src / debug_printf.h
blobcfbcbfe7eeb06aea8d49c8aef74edbbcef1b336c
1 #ifndef __DEBUG_PRINTF_H__
2 #define __DEBUG_PRINTF_H__
4 /**\defgroup 100debug Debug
5 */
6 /*@{*/
8 /**
9 */
10 typedef enum _DebugLevel {
11 /** No debug output */
12 DEBUG_NO_OUTPUT = 0,
13 /** Print only error messages */
14 DEBUG_ERROR = 1,
15 /** Print Error and Warning messages */
16 DEBUG_WARNING = 2,
17 /** Print only error message */
18 DEBUG_INFO = 3
19 } DebugLevel;
21 /**
22 * @param dl a #DebugLevel
24 * Set the debug level. if set to DEBUG_INFO everything is printed to stdout.
26 void debug_set_level(DebugLevel dl);
28 /** Internal function, do no use */
29 void debug_printf_real(DebugLevel dp, const char *file,const int line,const char *function, const char *format,...);
31 /**
32 * @param dp The debug level the message is at.
33 * @param format a printf style string
34 * @param ARGS arguments for format
36 #define debug_printf(dp, format, ARGS...) debug_printf_real(dp,__FILE__,__LINE__,__FUNCTION__,format,##ARGS)
38 /**
39 * @param fp a #FILE
41 * Redirect the output from stdout to fp.
42 * Set to NULL, to revert back to stdout.
44 void debug_set_output(FILE *fp);
45 /*@}*/
46 #endif