mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
allow (and use) symbolic names for syslog levels
This commit is contained in:
parent
0c75d26060
commit
6650f07f50
@ -96,6 +96,16 @@ This option tells
|
||||
at what level debugging statements should be logged to the
|
||||
.BR syslog (8)
|
||||
facility.
|
||||
The value can be any of
|
||||
"EMERG",
|
||||
"ALERT",
|
||||
"CRIT",
|
||||
"ERR",
|
||||
"WARNING",
|
||||
"NOTICE",
|
||||
"INFO" or
|
||||
"DEBUG",
|
||||
defaulting to "DEBUG".
|
||||
.TP
|
||||
.BI \-n " service\-name"
|
||||
Specifies the service name for logging and other purposes. Defaults
|
||||
|
@ -483,8 +483,32 @@ int main( int argc, char **argv )
|
||||
}
|
||||
|
||||
case 's': /* set syslog level */
|
||||
if ( lutil_atoi( &ldap_syslog_level, optarg ) != 0 ) {
|
||||
fprintf( stderr, "unable to parse syslog level \"%s\"", optarg );
|
||||
if ( !isdigit( optarg[ 0 ] ) ) {
|
||||
slap_verbmasks str2syslog_level[] = {
|
||||
{ BER_BVC( "EMERG" ), LOG_EMERG },
|
||||
{ BER_BVC( "ALERT" ), LOG_ALERT },
|
||||
{ BER_BVC( "CRIT" ), LOG_CRIT },
|
||||
{ BER_BVC( "ERR" ), LOG_ERR },
|
||||
{ BER_BVC( "WARNING" ), LOG_WARNING },
|
||||
{ BER_BVC( "NOTICE" ), LOG_NOTICE },
|
||||
{ BER_BVC( "INFO" ), LOG_INFO },
|
||||
{ BER_BVC( "DEBUG" ), LOG_DEBUG },
|
||||
{ BER_BVNULL, 0 }
|
||||
};
|
||||
int i = verb_to_mask( optarg, str2syslog_level );
|
||||
if ( BER_BVISNULL( &str2syslog_level[ i ].word ) ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"unknown syslog level \"%s\".\n",
|
||||
optarg, 0, 0 );
|
||||
goto destroy;
|
||||
}
|
||||
|
||||
ldap_syslog_level = str2syslog_level[ i ].mask;
|
||||
|
||||
} else if ( lutil_atoi( &ldap_syslog_level, optarg ) != 0 ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"unable to parse syslog level \"%s\".\n",
|
||||
optarg, 0, 0 );
|
||||
goto destroy;
|
||||
}
|
||||
break;
|
||||
|
@ -137,7 +137,7 @@ DIFF="diff -i"
|
||||
CMP="diff -i"
|
||||
BCMP="diff -iB"
|
||||
CMPOUT=/dev/null
|
||||
SLAPD="../servers/slapd/slapd -s0"
|
||||
SLAPD="../servers/slapd/slapd -sDEBUG"
|
||||
SLURPD=../servers/slurpd/slurpd
|
||||
LDAPPASSWD="$CLIENTDIR/ldappasswd $TOOLARGS"
|
||||
LDAPSASLSEARCH="$CLIENTDIR/ldapsearch $TOOLPROTO $LDAP_TOOLARGS -LLL"
|
||||
|
Loading…
Reference in New Issue
Block a user