Skip to content
Snippets Groups Projects
Commit c90f7362 authored by Olivier Fourdan's avatar Olivier Fourdan
Browse files

Revert last change in debug.h, use "??" instead of ((__const char *)0)

Replace DBG() statements with TRACE() in libxfcegui4 and xfwm4 because it was generating far too much logs in simple debug mode (use --enable-debug=full to get full traces)
Add params to TRACE() (just like in DBG())
Remove trailing CR in log messages


(Old svn revision: 686)
parent 353904ea
No related branches found
No related tags found
No related merge requests found
......@@ -31,30 +31,38 @@
#include <stdio.h>
#if defined(__NetBSD__) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
#define __DBG_FUNC__ __func__
#else
#define __DBG_FUNC__ "??"
#endif
#define DBG(fmt, args...) \
{ \
fprintf(stderr, "%s, line %d: ", __FILE__, __LINE__); \
fprintf(stderr, "DBG[%s:%d] %s(): ", __FILE__, __LINE__, __DBG_FUNC__); \
fprintf(stderr, fmt, ##args); \
fprintf(stderr, "\n"); \
}
#if defined(DEBUG_TRACE) && DEBUG_TRACE > 0
#define TRACE() \
#define TRACE(fmt, args...) \
{ \
fprintf(stderr, "TRACE %s, line %d: ", __FILE__, __LINE__); \
fprintf(stderr, "TRACE[%s:%d] %s(): ",__FILE__,__LINE__,__DBG_FUNC__); \
fprintf(stderr, fmt, ##args); \
fprintf(stderr, "\n"); \
}
#else /* !defined(DEBUG_TRACE) || DEBUG_TRACE <= 0 */
#define TRACE() { do {} while(0); }
#define TRACE(fmt, args...) { do {} while(0); }
#endif
#else /* !defined(DEBUG) || DEBUG <= 0 */
#define DBG(fmt, args...) { do {} while(0); }
#define TRACE() { do {} while(0); }
#define TRACE(fmt, args...) { do {} while(0); }
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment