3 * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12 #include <ac/stdarg.h>
13 #include <ac/string.h>
22 static int ldap_log_check( LDAP *ld, int loglvl )
29 errlvl = ld->ld_debug;
32 return errlvl & loglvl ? 1 : 0;
35 int ldap_log_printf( LDAP *ld, int loglvl, const char *fmt, ... )
40 if ( !ldap_log_check( ld, loglvl )) {
46 buf[sizeof(buf) - 1] = '\0';
47 vsnprintf( buf, sizeof(buf)-1, fmt, ap );
51 (*ber_pvt_log_print)( buf );