# HG changeset patch
# User Andre Heinecke <aheinecke@intevation.de>
# Date 1396446511 0
# Node ID b033b16dd290f55db6ed329bd3442374cf4ed3c8
# Parent  881ce5126f07d21f99baa01872a153fbc0da9a7a
Add OutputDebugString macro

    This helps when debugging interprocess calls on Windows where
    you do not get stdout on console

diff -r 881ce5126f07 -r b033b16dd290 common/logging.h
--- a/common/logging.h	Wed Apr 02 13:47:24 2014 +0000
+++ b/common/logging.h	Wed Apr 02 13:48:31 2014 +0000
@@ -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