aboutsummaryrefslogtreecommitdiff
path: root/src/logger.h
diff options
context:
space:
mode:
authorspv <spv@spv.sh>2025-11-17 12:37:33 -0500
committerspv <spv@spv.sh>2025-11-17 12:37:33 -0500
commitea30c450e690513f32398388938b01ab7c8efe3e (patch)
treea26c041efbd59d77ee031f66ee5691aaeb30e45f /src/logger.h
technically functional...
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