changeset 5:37e662c427a1

added message() macro
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Wed, 05 Jan 2011 22:32:12 +0900
parents 8781bb6d488d
children cd846ca24ca4
files debug.h
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/debug.h	Wed Jan 05 22:31:47 2011 +0900
+++ b/debug.h	Wed Jan 05 22:32:12 2011 +0900
@@ -11,4 +11,11 @@
         }                                                               \
     } while(0);
 
+#define message(level, fmt, ...)                                         \
+    do {                                                                \
+        if(debug >= level) {                                            \
+            fprintf(stderr, fmt, ## __VA_ARGS__); \
+        }                                                               \
+    } while(0);
+
 #endif