1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-01 07:26:57 +03:00

replace duplicate code with new function ap_parse_log_level()

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@905454 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Fritsch
2010-02-01 23:27:32 +00:00
parent 5314f77c08
commit 60821a3b74
6 changed files with 36 additions and 83 deletions

View File

@ -244,34 +244,9 @@ static const char *set_loglevel(cmd_parms *cmd, void *dummy, const char *arg)
}
if ((str = ap_getword_conf(cmd->pool, &arg))) {
if (!strcasecmp(str, "emerg")) {
ptr->loglevel = APLOG_EMERG;
}
else if (!strcasecmp(str, "alert")) {
ptr->loglevel = APLOG_ALERT;
}
else if (!strcasecmp(str, "crit")) {
ptr->loglevel = APLOG_CRIT;
}
else if (!strcasecmp(str, "error")) {
ptr->loglevel = APLOG_ERR;
}
else if (!strcasecmp(str, "warn")) {
ptr->loglevel = APLOG_WARNING;
}
else if (!strcasecmp(str, "notice")) {
ptr->loglevel = APLOG_NOTICE;
}
else if (!strcasecmp(str, "info")) {
ptr->loglevel = APLOG_INFO;
}
else if (!strcasecmp(str, "debug")) {
ptr->loglevel = APLOG_DEBUG;
}
else {
return "DumpIOLogLevel requires level keyword: one of "
"emerg/alert/crit/error/warn/notice/info/debug";
}
err = ap_parse_log_level(str, &ptr->loglevel);
if (err != NULL)
return err;
}
else {
return "DumpIOLogLevel requires level keyword";