blob: 6b5bb8e92710c2229c722554bc88d8528b1ab1a8 [file] [log] [blame]
Juan Cespedescac15c32003-01-31 18:58:58 +01001#include <stdio.h>
2#include <stdarg.h>
3
4#include "debug.h"
5#include "options.h"
6#include "output.h"
7
Ian Wienand3219f322006-02-16 06:00:00 +01008void debug_(int level, char *file, int line, const char *func, char *fmt, ...)
9{
Juan Cespedescac15c32003-01-31 18:58:58 +010010 char buf[1024];
11 va_list args;
12
13 if (opt_d < level) {
14 return;
15 }
16 va_start(args, fmt);
17 vsnprintf(buf, 1024, fmt, args);
18 va_end(args);
19
20 output_line(NULL, "DEBUG: %s:%d: %s(): %s", file, line, func, buf);
21}