]> git.ipfire.org Git - thirdparty/squid.git/blob - lib/snmplib/snmplib_debug.c
Merge from trunk
[thirdparty/squid.git] / lib / snmplib / snmplib_debug.c
1 #include "squid.h"
2
3 #if HAVE_SYS_TYPES_H
4 #include <sys/types.h>
5 #endif
6 #include <stdarg.h>
7
8 #include "snmp_debug.h"
9
10 void (*snmplib_debug_hook) (int, char *,...) = NULL;
11
12 extern void
13 snmplib_debug(int lvl, const char *fmt,...)
14 {
15 char buf[BUFSIZ];
16 va_list args;
17 va_start(args, fmt);
18
19 if (snmplib_debug_hook != NULL) {
20 vsnprintf(buf, BUFSIZ, fmt, args);
21 snmplib_debug_hook(lvl, buf);
22 } else {
23 vfprintf(stderr, fmt, args);
24 }
25 va_end(args);
26 }