summaryrefslogtreecommitdiff
path: root/compiler/debug.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-11-01 23:46:08 -0400
committerIan Moffett <ian@osmora.org>2024-11-01 23:46:08 -0400
commita515dfb3b8f8e999362db7a6b52b3104c03b750a (patch)
treed0180f0cbc39d9c3e367af30791ad774e4d419ff /compiler/debug.c
Import quark sources
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'compiler/debug.c')
-rw-r--r--compiler/debug.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler/debug.c b/compiler/debug.c
new file mode 100644
index 0000000..d14bca6
--- /dev/null
+++ b/compiler/debug.c
@@ -0,0 +1,20 @@
+/*
+ * Logging utilities.
+ * Copyright (c) 2023-2024, Quinn Stephens and the OSMORA team.
+ * Provided under the BSD 3-Clause license.
+ */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "debug.h"
+
+void
+__debug(const char *fmt, ...)
+{
+ va_list ap;
+
+ printf("\033[90mdebug:\033[0m ");
+ va_start(ap, fmt);
+ vprintf(fmt, ap);
+ va_end(ap);
+}