| Juan Cespedes | cac15c3 | 2003-01-31 18:58:58 +0100 | [diff] [blame^] | 1 | #include <stdio.h> |
| 2 | #include <stdarg.h> | ||||
| 3 | |||||
| 4 | #include "debug.h" | ||||
| 5 | #include "options.h" | ||||
| 6 | #include "output.h" | ||||
| 7 | |||||
| 8 | void | ||||
| 9 | debug_(int level, char *file, int line, char *func, char *fmt, ...) { | ||||
| 10 | 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 | } | ||||