mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
re-enable "-d '?'" as a means to list what loglevels are available (ITS#4666)
This commit is contained in:
parent
b60990780f
commit
c3f9d68027
@ -2358,6 +2358,28 @@ loglevel2bvarray( int l, BerVarray *bva )
|
||||
return mask_to_verbs( loglevel_ops, l, bva );
|
||||
}
|
||||
|
||||
int
|
||||
loglevel_print( FILE *out )
|
||||
{
|
||||
int i;
|
||||
|
||||
if ( loglevel_ops == NULL ) {
|
||||
loglevel_init();
|
||||
}
|
||||
|
||||
fprintf( out, "Installed log subsystems:\n\n" );
|
||||
for ( i = 0; !BER_BVISNULL( &loglevel_ops[ i ].word ); i++ ) {
|
||||
fprintf( out, "\t%-30s (%d)\n",
|
||||
loglevel_ops[ i ].word.bv_val,
|
||||
loglevel_ops[ i ].mask );
|
||||
}
|
||||
|
||||
fprintf( out, "\nNOTE: custom log subsystems may be later installed "
|
||||
"by specific code\n\n" );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int config_syslog;
|
||||
|
||||
static int
|
||||
|
@ -501,6 +501,11 @@ int main( int argc, char **argv )
|
||||
case 'd': { /* set debug level and 'do not detach' flag */
|
||||
int level = 0;
|
||||
|
||||
if ( strcmp( optarg, "?" ) == 0 ) {
|
||||
rc = loglevel_print( stdout );
|
||||
goto destroy;
|
||||
}
|
||||
|
||||
no_detach = 1;
|
||||
if ( parse_debug_level( optarg, &level, &debug_unknowns ) ) {
|
||||
goto destroy;
|
||||
@ -557,6 +562,11 @@ int main( int argc, char **argv )
|
||||
}
|
||||
|
||||
case 's': /* set syslog level */
|
||||
if ( strcmp( optarg, "?" ) == 0 ) {
|
||||
rc = loglevel_print( stdout );
|
||||
goto destroy;
|
||||
}
|
||||
|
||||
if ( parse_debug_level( optarg, &ldap_syslog, &syslog_unknowns ) ) {
|
||||
goto destroy;
|
||||
}
|
||||
|
@ -429,6 +429,7 @@ LDAP_SLAPD_F (int) str2loglevel LDAP_P(( const char *s, int *l ));
|
||||
LDAP_SLAPD_F (int) loglevel2bvarray LDAP_P(( int l, BerVarray *bva ));
|
||||
LDAP_SLAPD_F (const char *) loglevel2str LDAP_P(( int l ));
|
||||
LDAP_SLAPD_F (int) loglevel2bv LDAP_P(( int l, struct berval *bv ));
|
||||
LDAP_SLAPD_F (int) loglevel_print LDAP_P(( FILE *out ));
|
||||
LDAP_SLAPD_F (int) slap_cf_aux_table_parse LDAP_P(( const char *word, void *bc, slap_cf_aux_table *tab0, LDAP_CONST char *tabmsg ));
|
||||
LDAP_SLAPD_F (int) slap_cf_aux_table_unparse LDAP_P(( void *bc, struct berval *bv, slap_cf_aux_table *tab0 ));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user