aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/util.h b/src/util.h
index 376d132..9844360 100644
--- a/src/util.h
+++ b/src/util.h
@@ -5,13 +5,16 @@
#define ARRLEN(x) (sizeof(x) / sizeof((x)[0]))
-#define ERR(...) stdio_log(LOG_ERR, __VA_ARGS__)
-#define WARN(...) stdio_log(LOG_WARN, __VA_ARGS__)
-#define INFO(...) stdio_log(LOG_INFO, __VA_ARGS__)
-#define DEBUG(...) stdio_log(LOG_DEBUG, __VA_ARGS__)
+#define ERR(...) stdio_log(LOG_ERR, "ERR : " __VA_ARGS__)
+#define WARN(...) stdio_log(LOG_WARN, "WARN : " __VA_ARGS__)
+#define INFO(...) stdio_log(LOG_INFO, "INFO : " __VA_ARGS__)
+#define DEBUG(...) stdio_log(LOG_DEBUG, "DEBUG: " __VA_ARGS__)
+
#define PANIC(...) blink_panic(__VA_ARGS__);
-#define ASSERT(cond) blink_panic("Assertion failed: (%s) in %s:%i", \
- #cond, __FILE__, __LINE__)
+#define ASSERT(cond) do { \
+ if (!(cond)) blink_panic("Assertion failed: (%s) in %s:%i", \
+ #cond, __FILE__, __LINE__); \
+ } while (0)
enum {
LOG_NONE,