summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 45bd61e)
raw | patch | inline | side by side (parent: 45bd61e)
author | Florian Forster <octo@collectd.org> | |
Sat, 25 Feb 2012 16:12:45 +0000 (17:12 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Sat, 25 Feb 2012 16:12:45 +0000 (17:12 +0100) |
Change-Id: I078ca80ba6e3cac413186c2ad063d32cdfbb398e
src/plugin.c | patch | blob | history | |
src/plugin.h | patch | blob | history |
diff --git a/src/plugin.c b/src/plugin.c
index fac4d779568c3d98deac69a354010109606a60a4..cdd56bd79dd8f2f4d0c6374c7d33fe5ebbe224d7 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
{
int notif_severity = -1;
- if (strcasecmp (severity, "FAILURE"))
+ if (strcasecmp (severity, "FAILURE") == 0)
notif_severity = NOTIF_FAILURE;
- else if (strcmp (severity, "OKAY"))
+ else if (strcmp (severity, "OKAY") == 0)
notif_severity = NOTIF_OKAY;
- else if ((strcmp (severity, "WARNING"))
- || (strcmp (severity, "WARN")))
+ else if ((strcmp (severity, "WARNING") == 0)
+ || (strcmp (severity, "WARN") == 0))
notif_severity = NOTIF_WARNING;
return (notif_severity);
diff --git a/src/plugin.h b/src/plugin.h
index 56f927be4f083854ac32bbcb275a254f89225c61..dd65b5982c6eb6ca80e5f8b63d947a00a05ca132 100644 (file)
--- a/src/plugin.h
+++ b/src/plugin.h
void plugin_log (int level, const char *format, ...)
__attribute__ ((format(printf,2,3)));
+
+/* These functions return the parsed severity or less than zero on failure. */
int parse_log_severity (const char *severity);
int parse_notif_severity (const char *severity);