#include "ldapconfig.h"
#include "lber.h"
#include "ldap.h"
+
+#define ldap_debug debug
#include "ldap_log.h"
+
#include "lutil.h"
#include "disptmpl.h"
break;
case 'd': /* debug level */
- debug = atoi( optarg );
+ debug |= atoi( optarg );
break;
case 'f': /* ldap filter file */
}
#endif /* FD_SETSIZE*/
-
/* detach if stderr is redirected or no debugging */
if ( inetd == 0 )
lutil_detach( debug && !isatty( 1 ), 1 );
else
myname = strdup( myname + 1 );
+ if ( debug ) {
+ lber_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &debug);
+ ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &debug);
+ }
+
if ( dosyslog ) {
#ifdef LOG_LOCAL3
openlog( myname, OPENLOG_OPTIONS, LOG_LOCAL3 );