Added back the *DEBUG macros so you can choose which debug
messages you get by defining one or more of those macros. Added configure switch to enable them.
This commit is contained in:
parent
de243e9396
commit
3316d1e0b4
|
@ -205,6 +205,18 @@ dnl - Enable debug mode
|
|||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING(--enable-debug, enable debug information),
|
||||
AC_DEFINE(DEBUG))
|
||||
AC_ARG_ENABLE(gpu-debug,
|
||||
AC_HELP_STRING(--enable-gpu-debug, enable gpu debug information),
|
||||
AC_DEFINE(GPUDEBUG))
|
||||
AC_ARG_ENABLE(div-debug,
|
||||
AC_HELP_STRING(--enable-div-debug, enable div debug information),
|
||||
AC_DEFINE(DIVDEBUG))
|
||||
AC_ARG_ENABLE(sqrt-debug,
|
||||
AC_HELP_STRING(--enable-sqrt-debug, enable sqrt debug information),
|
||||
AC_DEFINE(SQRTDEBUG))
|
||||
AC_ARG_ENABLE(dma-debug,
|
||||
AC_HELP_STRING(--enable-dma-debug, enable dma debug information),
|
||||
AC_DEFINE(DMADEBUG))
|
||||
|
||||
dnl - Enable memory profiling
|
||||
AC_ARG_ENABLE(memory-profiling,
|
||||
|
|
|
@ -51,26 +51,40 @@ public:
|
|||
static void log(unsigned int channel, const char * file, unsigned int line, void (*callback)(const Logger& logger, const char * message));
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
#if defined(DEBUG) || defined(GPUDEBUG) || defined(DIVDEBUG) || defined(SQRTDEBUG) || defined(DMADEBUG)
|
||||
#define LOGC(channel, ...) Logger::log(channel, __FILE__, __LINE__, __VA_ARGS__)
|
||||
#define LOG(...) LOGC(0, __VA_ARGS__)
|
||||
|
||||
#define GPULOG(...) LOGC(1, __VA_ARGS__)
|
||||
#define DIVLOG(...) LOGC(2, __VA_ARGS__)
|
||||
#define SQRTLOG(...) LOGC(3, __VA_ARGS__)
|
||||
#define DMALOG(...) LOGC(3, __VA_ARGS__)
|
||||
|
||||
#else
|
||||
|
||||
#define LOGC(...)
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#define LOG(...) LOGC(0, __VA_ARGS__)
|
||||
#else
|
||||
#define LOG(...)
|
||||
#endif
|
||||
|
||||
#ifdef GPUDEBUG
|
||||
#define GPULOG(...) LOGC(1, __VA_ARGS__)
|
||||
#else
|
||||
#define GPULOG(...)
|
||||
#define DIVLOG(...)
|
||||
#define SQRTLOG(...)
|
||||
#define DMALOG(...)
|
||||
#endif
|
||||
|
||||
#ifdef DIVDEBUG
|
||||
#define DIVLOG(...) LOGC(2, __VA_ARGS__)
|
||||
#else
|
||||
#define DIVLOG(...)
|
||||
#endif
|
||||
|
||||
#ifdef SQRTDEBUG
|
||||
#define SQRTLOG(...) LOGC(3, __VA_ARGS__)
|
||||
#else
|
||||
#define SQRTLOG(...)
|
||||
#endif
|
||||
|
||||
#ifdef DMADEBUG
|
||||
#define DMALOG(...) LOGC(4, __VA_ARGS__)
|
||||
#else
|
||||
#define DMALOG(...)
|
||||
#endif
|
||||
|
||||
#define INFOC(channel, ...) Logger::log(channel, __FILE__, __LINE__, __VA_ARGS__)
|
||||
|
|
Loading…
Reference in New Issue