aboutsummaryrefslogtreecommitdiff
path: root/src/logger.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/logger.h')
-rw-r--r--src/logger.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/logger.h b/src/logger.h
new file mode 100644
index 0000000..4350cf1
--- /dev/null
+++ b/src/logger.h
@@ -0,0 +1,22 @@
+#ifndef LOGGER_H
+#define LOGGER_H
+
+#include <stdio.h>
+
+enum log_levels {
+ LOG_ERROR,
+ LOG_INFO,
+ LOG_DEBUG,
+ LOG_INSANEDEBUG,
+};
+
+#define LOGFP stderr
+#define LOGLEVEL
+
+#define LOG(LEVEL, args...) do { \
+ if (LEVEL <= LOG_LEVEL) { \
+ fprintf(LOGFP, args); \
+ } \
+} while (0)
+
+#endif