summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/util/debug.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/server/util/debug.c b/server/util/debug.c
new file mode 100644
index 00000000..0814bb7b
--- /dev/null
+++ b/server/util/debug.c
@@ -0,0 +1,20 @@
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+
+int debug_level = 2;
+
+void debug_fn(const char *format, ...)
+{
+ va_list ap;
+ char *s = NULL;
+
+ va_start(ap, format);
+ vasprintf(&s, format, ap);
+ va_end(ap);
+
+ /*write(state.fd, s, strlen(s));*/
+ fprintf(stderr, s);
+ free(s);
+}