2 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <ac/stdarg.h>
12 #include <ac/string.h>
21 static int ldap_log_check( LDAP *ld, int loglvl )
28 errlvl = ld->ld_errno;
31 return errlvl & loglvl ? 1 : 0;
34 int ldap_log_printf( LDAP *ld, int loglvl, const char *fmt, ... )
39 if ( !ldap_log_check( ld, loglvl )) {
46 buf[sizeof(buf) - 1] = '\0';
47 vsnprintf( buf, sizeof(buf)-1, fmt, ap );
49 vsprintf( buf, fmt, ap ); /* hope it's not too long */
52 chokeme = "choke me! I don't have a doprnt manual handy!";
57 (*ber_pvt_log_print)( buf );