]> git.ipfire.org Git - thirdparty/squid.git/blame - lib/snmplib/snmplib_debug.c
SourceFormat Enforcement
[thirdparty/squid.git] / lib / snmplib / snmplib_debug.c
CommitLineData
c04fda28 1/*
4ac4a490 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
c04fda28
AJ
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
f7f3304a 9#include "squid.h"
074d6a40 10
99d08e11 11#if HAVE_SYS_TYPES_H
12#include <sys/types.h>
13#endif
8e79c699 14#include <stdarg.h>
8e79c699 15
d75eeb78 16#include "snmp_debug.h"
17
43d4303e 18void (*snmplib_debug_hook) (int, char *,...) = NULL;
8e79c699 19
20extern void
e1381638 21snmplib_debug(int lvl, const char *fmt,...)
8e79c699 22{
5e14bf6d 23 char buf[BUFSIZ];
24 va_list args;
25 va_start(args, fmt);
8d707f3d 26
5e14bf6d 27 if (snmplib_debug_hook != NULL) {
26ac0430
AJ
28 vsnprintf(buf, BUFSIZ, fmt, args);
29 snmplib_debug_hook(lvl, buf);
5e14bf6d 30 } else {
26ac0430 31 vfprintf(stderr, fmt, args);
5e14bf6d 32 }
33 va_end(args);
8e79c699 34}
f53969cc 35