Added: severity action now supports strings

This commit is contained in:
Breno Silva
2013-06-03 19:49:45 -07:00
parent 5ee4c1786c
commit f955ba7e7b

View File

@@ -491,7 +491,25 @@ static apr_status_t msre_action_ver_init(msre_engine *engine,
static apr_status_t msre_action_severity_init(msre_engine *engine,
msre_actionset *actionset, msre_action *action)
{
if (strcasecmp(action->param, "emergency") == 0) {
actionset->severity = 0;
} else if (strcasecmp(action->param, "alert") == 0) {
actionset->severity = 1;
} else if (strcasecmp(action->param, "critical") == 0) {
actionset->severity = 2;
} else if (strcasecmp(action->param, "error") == 0) {
actionset->severity = 3;
} else if (strcasecmp(action->param, "warning") == 0) {
actionset->severity = 4;
} else if (strcasecmp(action->param, "notice") == 0) {
actionset->severity = 5;
} else if (strcasecmp(action->param, "info") == 0) {
actionset->severity = 6;
} else if (strcasecmp(action->param, "debug") == 0) {
actionset->severity = 7;
} else {
actionset->severity = atoi(action->param);
}
return 1;
}