summaryrefslogtreecommitdiffstats
path: root/src/lisiblestd/log.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lisiblestd/log.h')
-rw-r--r--src/lisiblestd/log.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lisiblestd/log.h b/src/lisiblestd/log.h
new file mode 100644
index 0000000..c280034
--- /dev/null
+++ b/src/lisiblestd/log.h
@@ -0,0 +1,18 @@
+#ifndef LSTD_LOG_H
+#define LSTD_LOG_H
+
+#include <stdio.h>
+
+#define LOG_PREFIX "[%s:%d] "
+
+#define LOG0(msg) \
+ do { \
+ fprintf(stderr, LOG_PREFIX "%s\n", __FILE__, __LINE__, msg); \
+ } while (0)
+
+#define LOG(fmt, ...) \
+ do { \
+ fprintf(stderr, LOG_PREFIX fmt "\n", __FILE__, __LINE__, __VA_ARGS__); \
+ } while (0)
+
+#endif // LSTD_LOG_H
Go back to lisible.xyz