diff options
Diffstat (limited to 'debug.c')
-rw-r--r-- | debug.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -0,0 +1,21 @@ +#include <stdio.h> +#include <stdarg.h> + +#include "debug.h" +#include "options.h" +#include "output.h" + +void +debug_(int level, char *file, int line, char *func, char *fmt, ...) { + char buf[1024]; + va_list args; + + if (opt_d < level) { + return; + } + va_start(args, fmt); + vsnprintf(buf, 1024, fmt, args); + va_end(args); + + output_line(NULL, "DEBUG: %s:%d: %s(): %s", file, line, func, buf); +} |