Logic Analyzer RPi
Logic Analyzer for the Raspberry Pi
 All Classes Files Functions Variables Pages
debug.h
1 #include <stdarg.h>
2 
4 typedef enum
5 {
6  CRITICAL = 0,
7  ERROR = 1,
8  WARNING = 2,
9  INFORMATION = 3,
10  DEBUG = 4,
11 }debug_level;
12 
13 extern debug_level msglevel; /* the higher, the more messages... */
14 
15 #if defined(NDEBUG) && defined(__GNUC__)
16 /* gcc's cpp has extensions; it allows for macros with a variable number of
17  arguments. We use this extension here to preprocess pmesg away. */
18 #define pmesg(level, format, args...) ((void)0)
19 #else
20 
21 
25 void pmesg(debug_level level, const char format[], ...);
26 /* print a message, if it is considered significant enough.
27  Adapted from oopweb.com/CPP/Documents/DebugCPP/Volume/techniques.html*/
28 #endif
29