Merge pull request #660 from mfournier/logfile-log_level
authorPierre-Yves Ritschard <pyr@spootnik.org>
Fri, 25 Jul 2014 14:07:04 +0000 (16:07 +0200)
committerPierre-Yves Ritschard <pyr@spootnik.org>
Fri, 25 Jul 2014 14:07:04 +0000 (16:07 +0200)
Logfile log level

src/logfile.c
src/syslog.c

index 0f20f3c..63448cb 100644 (file)
@@ -54,7 +54,11 @@ static int logfile_config (const char *key, const char *value)
 {
        if (0 == strcasecmp (key, "LogLevel")) {
                log_level = parse_log_severity(value);
-               if (log_level == -1) return 1; /* to keep previous behaviour */
+               if (log_level < 0) {
+                       log_level = LOG_INFO;
+                       ERROR ("logfile: invalid loglevel [%s] defaulting to 'info'", value);
+                       return (1);
+               }
        }
        else if (0 == strcasecmp (key, "File")) {
                sfree (log_file);
index 1a70fd0..834ba79 100644 (file)
@@ -50,7 +50,7 @@ static int sl_config (const char *key, const char *value)
                if (log_level < 0)
                {
                        log_level = LOG_INFO;
-                       ERROR ("syslog: invalid loglevel [%s] defauling to 'info'", value);
+                       ERROR ("syslog: invalid loglevel [%s] defaulting to 'info'", value);
                        return (1);
                }
        }