File: debug_printf.h

package info (click to toggle)
libmpd 0.12.0-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,580 kB
  • ctags: 571
  • sloc: sh: 8,060; ansic: 4,906; makefile: 67
file content (36 lines) | stat: -rw-r--r-- 831 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef __DEBUG_PRINTF_H__
#define __DEBUG_PRINTF_H__

/**\defgroup 100debug Debug
 */
/*@{*/

/**
 */
typedef enum _DebugLevel {
	/** No debug output */
	DEBUG_NO_OUTPUT = 0,
	/** Print only error messages */
	DEBUG_ERROR = 1,
	/** Print Error and Warning messages */
	DEBUG_WARNING = 2,
	/** Print only error message */
	DEBUG_INFO = 3
} DebugLevel;

/**
 * Set the debug level
 */
void debug_set_level(DebugLevel dl);

/** Internal function, do no use */
void debug_printf_real(DebugLevel dp, const char *file,const int line,const char *function, const char *format,...);

/** 
 * @param dp The debug level the message is at.
 * @param format a printf style string
 * @param ARGS arguments for format
 */
#define debug_printf(dp, format, ARGS...) debug_printf_real(dp,__FILE__,__LINE__,__FUNCTION__,format,##ARGS)
/*@}*/
#endif