aboutsummaryrefslogtreecommitdiff
path: root/log.h
diff options
context:
space:
mode:
Diffstat (limited to 'log.h')
-rw-r--r--log.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/log.h b/log.h
new file mode 100644
index 0000000..88254bc
--- /dev/null
+++ b/log.h
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: ISC
+// SPDX-FileCopyrightText: 2024 Matthew Wozniak <me@woz.blue>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define die(fmt, ...) {\
+ fprintf(stderr, "err: " __FILE__ ": " fmt "\n", __VA_ARGS__); \
+ exit(1); \
+}
+
+#define warn(fmt, ...) \
+ fprintf(stderr, "warn: " __FILE__ ": " fmt "\n", __VA_ARGS__)
+
+#define info(fmt, ...) \
+ fprintf(stderr, "info: " __FILE__ ": " fmt "\n", __VA_ARGS__)
+
+// vi: sw=4 ts=4 noet tw=80 cc=80