summaryrefslogtreecommitdiff
path: root/src/log.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/log.h')
-rw-r--r--src/log.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/log.h b/src/log.h
new file mode 100644
index 0000000..1717011
--- /dev/null
+++ b/src/log.h
@@ -0,0 +1,20 @@
+#pragma once
+
+#include <stdio.h>
+
+#define dbg(format, ...) \
+ dbgl(format "\n", ## __VA_ARGS__)
+
+#define dbgl(format, ...) \
+ printf(format, ## __VA_ARGS__); \
+ fflush(stderr)
+
+#define err(format, ...) \
+ printf(format "\n", ## __VA_ARGS__); \
+ fflush(stderr)
+
+#define fatal(format, ...) \
+ printf(format "\n", ## __VA_ARGS__); \
+ fflush(stderr); \
+ abort()
+