1#ifndef _BLUETOOTH_DEBUG_SERVER_H_ 2#define _BLUETOOTH_DEBUG_SERVER_H_ 3 4#ifndef DEBUG 5 #define DEBUG 3 6#endif 7 8#include <Debug.h> 9#include <stdio.h> 10 11#undef TRACE 12#undef PRINT 13#if DEBUG > 0 14 inline void ERROR(const char *fmt, ...) 15 { 16 va_list ap; 17 va_start(ap, fmt); 18 printf("### ERROR: "); 19 vprintf(fmt, ap); va_end(ap); 20 } 21/* 22 inline void PRINT(int level, const char *fmt, ...) 23 { 24 va_list ap; 25 if (level > DEBUG) 26 return; 27 va_start(ap, fmt); 28 vprintf(fmt, ap); 29 va_end(ap); 30 } 31 32 inline void PRINT(const char *fmt, ...) 33 { 34 va_list ap; 35 va_start(ap, fmt); 36 vprintf(fmt, ap); 37 va_end(ap); 38 }*/ 39 40 #if DEBUG >= 2 41 #define TRACE(a...) printf("TRACE %s : %s\n", __PRETTY_FUNCTION__, a) 42 #else 43 #define TRACE(a...) ((void)0) 44 #endif 45 46 #if DEBUG >= 3 47 #define END() printf("ENDING %s\n",__PRETTY_FUNCTION__) 48 #define CALLED() printf("CALLED %s\n",__PRETTY_FUNCTION__) 49 #else 50 #define END() ((void)0) 51 #define CALLED() ((void)0) 52 #endif 53#else 54 #define END() ((void)0) 55 #define CALLED() ((void)0) 56 #define ERROR(a...) fprintf(stderr, a) 57 #define TRACE(a...) ((void)0) 58#endif 59 60#define PRINT(l, a...) printf(l, a) 61 62#endif /* _BLUETOOTH_DEBUG_SERVER_H_ */ 63