5 ** Initial version by Axel Dörfler, axeld@pinc-software.de
6 ** This file may be used under the terms of the MIT License.
17 #define __out DEBUG_PRINTF
22 // Short overview over the debug output macros:
24 // is for general messages that very unlikely should appear in a release build
26 // this is for fatal messages, when something has really gone wrong
28 // general information, as disk size, etc.
29 // REPORT_ERROR(status_t)
30 // prints out error information
31 // RETURN_ERROR(status_t)
32 // calls REPORT_ERROR() and return the value
34 // the statements in D() are only included if DEBUG is defined
36 #define DEBUG_APP "REG"
38 #define PRINT(x...) { __out(DEBUG_APP ": " x); }
39 #define REPORT_ERROR(status) \
40 __out(DEBUG_APP ": %s:%d: %s\n", __FUNCTION__, __LINE__, \
42 #define RETURN_ERROR(err) \
44 status_t _status = err; \
46 REPORT_ERROR(_status); \
49 #define SET_ERROR(var, err) \
51 status_t _status = err; \
53 REPORT_ERROR(_status); \
56 #define FATAL(x...) { __out(DEBUG_APP ": " x); }
57 #define ERROR(x...) { __out(DEBUG_APP ": " x); }
58 #define WARNING(x...) { __out(DEBUG_APP ": " x); }
59 #define INFORM(x...) { __out(DEBUG_APP ": " x); }
60 #define FUNCTION(x) { __out(DEBUG_APP ": %s() ",__FUNCTION__); __out x; }
61 #define FUNCTION_START() { __out(DEBUG_APP ": %s()\n",__FUNCTION__); }
62 #define FUNCTION_END() { __out(DEBUG_APP ": %s() done\n",__FUNCTION__); }
66 #define REPORT_ERROR(status) ;
67 #define RETURN_ERROR(status) return status;
68 #define SET_ERROR(var, err) var = err;
69 #define FATAL(x...) { __out(DEBUG_APP ": " x); }
70 #define ERROR(x...) { __out(DEBUG_APP ": " x); }
71 #define WARNING(x...) { __out(DEBUG_APP ": " x); }
72 #define INFORM(x...) { __out(DEBUG_APP ": " x); }
73 #define FUNCTION(x...) ;
74 #define FUNCTION_START() ;
75 #define FUNCTION_END() ;