]>
Commit | Line | Data |
---|---|---|
f7f3304a | 1 | #include "squid.h" |
8e79c699 | 2 | #if HAVE_STDIO_H |
3 | #include <stdio.h> | |
4 | #endif | |
99d08e11 | 5 | #if HAVE_SYS_TYPES_H |
6 | #include <sys/types.h> | |
7 | #endif | |
8e79c699 | 8 | #include <stdarg.h> |
8e79c699 | 9 | |
d75eeb78 | 10 | #include "snmp_debug.h" |
11 | ||
43d4303e | 12 | void (*snmplib_debug_hook) (int, char *,...) = NULL; |
8e79c699 | 13 | |
14 | extern void | |
e1381638 | 15 | snmplib_debug(int lvl, const char *fmt,...) |
8e79c699 | 16 | { |
5e14bf6d | 17 | char buf[BUFSIZ]; |
18 | va_list args; | |
19 | va_start(args, fmt); | |
8d707f3d | 20 | |
5e14bf6d | 21 | if (snmplib_debug_hook != NULL) { |
26ac0430 AJ |
22 | vsnprintf(buf, BUFSIZ, fmt, args); |
23 | snmplib_debug_hook(lvl, buf); | |
5e14bf6d | 24 | } else { |
26ac0430 | 25 | vfprintf(stderr, fmt, args); |
5e14bf6d | 26 | } |
27 | va_end(args); | |
8e79c699 | 28 | } |