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;
36 ( LDAP *ld, int loglvl, char *fmt, ... )
54 ld = va_arg( ap, LDAP * );
55 loglvl = va_arg( ap, int );
56 fmt = va_arg( ap, char * );
59 if ( !ldap_log_check( ld, loglvl )) {
64 buf[sizeof(buf) - 1] = '\0';
65 vsnprintf( buf, sizeof(buf)-1, fmt, ap );
67 vsprintf( buf, fmt, ap ); /* hope it's not too long */
70 chokeme = "choke me! I don't have a doprnt manual handy!";
75 (*lber_pvt_log_print)( buf );