summaryrefslogtreecommitdiff
path: root/server/util/debug.c
blob: 0814bb7b648e509e99071b1a7cc59884962516fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
}