Debug printf now more verbose about location of the error.
This commit is contained in:
parent
02abe530a8
commit
c49a4f518e
@ -24,16 +24,16 @@
|
||||
|
||||
#define DEBUG_NULL(fmt, ...) do { } while (0)
|
||||
#define DEBUG_PRINT(_dbg_str, fmt, ...) do { \
|
||||
fprintf(stderr, _dbg_str, __FUNCTION__, __LINE__); \
|
||||
fprintf(stderr, _dbg_str, __FUNCTION__, __FILE__, __LINE__); \
|
||||
fprintf(stderr, fmt, ## __VA_ARGS__); \
|
||||
fprintf(stderr, "\n"); \
|
||||
} while( 0 )
|
||||
|
||||
#define DEBUG_CLASS(_dbg_class, fmt, ...) DEBUG_PRINT("DBG_" #_dbg_class " %s (%d): ", fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_WARN(fmt, ...) DEBUG_PRINT("Warning %s (%d): ", fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_CLASS(_dbg_class, fmt, ...) DEBUG_PRINT("DBG_" #_dbg_class " %s (%s:%d): ", fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_WARN(fmt, ...) DEBUG_PRINT("Warning %s (%s:%d): ", fmt, ## __VA_ARGS__)
|
||||
|
||||
#ifdef WITH_DEBUG
|
||||
#define DEBUG_MSG(fmt, ...) DEBUG_PRINT("DBG %s (%d): ", fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_MSG(fmt, ...) DEBUG_PRINT("DBG %s (%s:%d): ", fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_MSG(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user