aboutsummaryrefslogtreecommitdiff
path: root/src/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/log.c b/src/log.c
new file mode 100644
index 0000000..dd3c33e
--- /dev/null
+++ b/src/log.c
@@ -0,0 +1,31 @@
+#include <stdarg.h>
+#include <stdio.h>
+
+#include <log.h>
+
+#define LOG_OUT stdout
+#define ERR_OUT stderr
+
+void __logln(const char *func, const char *format, ...)
+{
+ fprintf(LOG_OUT, "[LOG] %s: ", func);
+
+ va_list ap;
+ va_start(ap, format);
+ vfprintf(LOG_OUT, format, ap);
+ va_end(ap);
+
+ fprintf(LOG_OUT, "\n");
+}
+
+void __errln(const char *func, const char *format, ...)
+{
+ fprintf(ERR_OUT, "[ERR] %s: ", func);
+
+ va_list ap;
+ va_start(ap, format);
+ vfprintf(ERR_OUT, format, ap);
+ va_end(ap);
+
+ fprintf(ERR_OUT, "\n");
+}