summaryrefslogtreecommitdiff
path: root/src/utils/log.c
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-01-18 20:42:54 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-01-18 20:49:30 +0330
commit43392fc66ab207e53a6924a2edbcd7ca0acecea8 (patch)
tree5a064c4e144035d1a07f31f767417b9e44b2ebbf /src/utils/log.c
initial commit
Diffstat (limited to 'src/utils/log.c')
-rw-r--r--src/utils/log.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/utils/log.c b/src/utils/log.c
new file mode 100644
index 0000000..f54394a
--- /dev/null
+++ b/src/utils/log.c
@@ -0,0 +1,15 @@
+#include "log.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void _printLogBack(const char *format, const char *file, int line, ...) {
+ va_list args;
+ va_start(args, end);
+ char *errorStr;
+ vasprintf(&errorStr, format, args);
+
+ printf("\e[0;31mError: %s at compiler %s:%d\e[0m\n", errorStr, file, line);
+ free(errorStr);
+}