Mercurial > trustbridge
diff common/logging.h @ 310:f758460ca437
Merged
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Fri, 04 Apr 2014 09:54:19 +0200 |
parents | b033b16dd290 |
children | b1059360a0c7 |
line wrap: on
line diff
--- a/common/logging.h Fri Apr 04 09:53:55 2014 +0200 +++ b/common/logging.h Fri Apr 04 09:54:19 2014 +0200 @@ -56,6 +56,34 @@ #define DEBUGPRINTF(fmt, ...) #endif +/** + * @def DEBUGMSG(msg) + * @brief Prints a static debug message + * + * If DEBUGOUTPUT is defined this. Prints a debug message + * to stdout on Unix systems. On Windows OutputDebugString is used. + */ +#ifdef DEBUGOUTPUT +# ifdef WIN32 +# define DEBUGMSG(msg) OutputDebugString (msg); +# else +# define DEBUGMSG(msg) printf (DEBUGPREFIX "DEBUG: " msg "\n"); +# endif +#else +# define DEBUGPRINTF(fmt, ...) +#endif + + +/** + * @def ERRORPRINTF(fmt, ...) + * @brief Debug printf + * + * Prints an error to stderr + */ +#define ERRORPRINTF(fmt, ...) fprintf(stderr, DEBUGPREFIX "ERROR: " fmt, ##__VA_ARGS__); + + + #ifdef __cplusplus } #endif