Commit accc1724 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Debug level can now be set using multiple flags, values are bitwise OR'ed.

parent 7139d725
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "slap.h" #include "slap.h"
#include "ldapconfig.h" #include "ldapconfig.h"
extern void daemon(); extern void slapd_daemon();
extern int lber_debug; extern int lber_debug;
extern char Versionstr[]; extern char Versionstr[];
...@@ -19,7 +19,7 @@ extern char Versionstr[]; ...@@ -19,7 +19,7 @@ extern char Versionstr[];
* read-only global variables or variables only written by the listener * read-only global variables or variables only written by the listener
* thread (after they are initialized) - no need to protect them with a mutex. * thread (after they are initialized) - no need to protect them with a mutex.
*/ */
int ldap_debug; int ldap_debug = 0;
#ifdef LDAP_DEBUG #ifdef LDAP_DEBUG
int ldap_syslog = LDAP_DEBUG_STATS; int ldap_syslog = LDAP_DEBUG_STATS;
#else #else
...@@ -63,7 +63,7 @@ static ...@@ -63,7 +63,7 @@ static
usage( name ) usage( name )
char *name; char *name;
{ {
fprintf( stderr, "usage: %s [-d debuglevel] [-f configfile] [-p portnumber] [-s sysloglevel]\n", name ); fprintf( stderr, "usage: %s [-d ?|debuglevel] [-f configfile] [-p portnumber] [-s sysloglevel]\n", name );
} }
main( argc, argv ) main( argc, argv )
...@@ -105,19 +105,19 @@ main( argc, argv ) ...@@ -105,19 +105,19 @@ main( argc, argv )
LDAP_DEBUG_CONFIG ); LDAP_DEBUG_CONFIG );
printf( "\tLDAP_DEBUG_ACL\t\t%d\n", printf( "\tLDAP_DEBUG_ACL\t\t%d\n",
LDAP_DEBUG_ACL ); LDAP_DEBUG_ACL );
printf( "\tLDAP_DEBUG_STATS\t\t%d\n", printf( "\tLDAP_DEBUG_STATS\t%d\n",
LDAP_DEBUG_STATS ); LDAP_DEBUG_STATS );
printf( "\tLDAP_DEBUG_STATS2\t\t%d\n", printf( "\tLDAP_DEBUG_STATS2\t%d\n",
LDAP_DEBUG_STATS2 ); LDAP_DEBUG_STATS2 );
printf( "\tLDAP_DEBUG_SHELL\t\t%d\n", printf( "\tLDAP_DEBUG_SHELL\t%d\n",
LDAP_DEBUG_SHELL ); LDAP_DEBUG_SHELL );
printf( "\tLDAP_DEBUG_PARSE\t\t%d\n", printf( "\tLDAP_DEBUG_PARSE\t%d\n",
LDAP_DEBUG_PARSE ); LDAP_DEBUG_PARSE );
printf( "\tLDAP_DEBUG_ANY\t\t%d\n", printf( "\tLDAP_DEBUG_ANY\t\t%d\n",
LDAP_DEBUG_ANY ); LDAP_DEBUG_ANY );
exit( 0 ); exit( 0 );
} else { } else {
ldap_debug = atoi( optarg ); ldap_debug |= atoi( optarg );
lber_debug = (ldap_debug & LDAP_DEBUG_BER); lber_debug = (ldap_debug & LDAP_DEBUG_BER);
} }
break; break;
...@@ -184,7 +184,7 @@ main( argc, argv ) ...@@ -184,7 +184,7 @@ main( argc, argv )
pthread_attr_init( &attr ); pthread_attr_init( &attr );
pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED ); pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
if ( pthread_create( &listener_tid, attr, (void *) daemon, if ( pthread_create( &listener_tid, &attr, (void *) slapd_daemon,
(void *) port ) != 0 ) { (void *) port ) != 0 ) {
Debug( LDAP_DEBUG_ANY, Debug( LDAP_DEBUG_ANY,
"listener pthread_create failed\n", 0, 0, 0 ); "listener pthread_create failed\n", 0, 0, 0 );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment