From: Florian Forster Date: Sat, 25 Feb 2012 16:25:50 +0000 (+0100) Subject: syslog plugin: Parse "value" as severity, not "key". X-Git-Tag: collectd-5.1.0~23 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c888188e5aabb3600d30ef48202b6f1c53349024;p=collectd.git syslog plugin: Parse "value" as severity, not "key". Change-Id: I4a7bde018be5a8925c9a998cd3e89e0289453063 --- diff --git a/src/syslog.c b/src/syslog.c index fc34e56c..d584eec9 100644 --- a/src/syslog.c +++ b/src/syslog.c @@ -33,7 +33,7 @@ static int log_level = LOG_DEBUG; #else static int log_level = LOG_INFO; #endif /* COLLECT_DEBUG */ -static int notif_severity = -1; +static int notif_severity = 0; static const char *config_keys[] = { @@ -47,11 +47,14 @@ static int sl_config (const char *key, const char *value) if (strcasecmp (key, "LogLevel") == 0) { log_level = parse_log_severity (value); - if (log_level == -1) return (1); + if (log_level < 0) + return (1); } else if (strcasecmp (key, "NotifyLevel") == 0) { - notif_severity = parse_notif_severity(key); + notif_severity = parse_notif_severity (value); + if (notif_severity < 0) + return (1); } return (0);