mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 14:07:59 +00:00
use isc_log_wouldlog() to avoid unnecessary formatting work
when the debug level does not warrant logging
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: socket.c,v 1.147 2000/07/10 19:40:06 explorer Exp $ */
|
||||
/* $Id: socket.c,v 1.148 2000/07/13 00:25:38 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -245,6 +245,9 @@ socket_log(isc_socket_t *sock, isc_sockaddr_t *address,
|
||||
char peerbuf[256];
|
||||
va_list ap;
|
||||
|
||||
if (! isc_log_wouldlog(isc_lctx, level))
|
||||
return;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
|
||||
va_end(ap);
|
||||
|
Reference in New Issue
Block a user