From d192d5665c0e03c2f3ca1cb64ce0335cb2e0c7fc Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Fri, 13 Nov 2015 19:39:43 +0900 Subject: [PATCH] detect_log_level(): return -1 to indicate invalid log level 0 is EMERG, which is not actually used but is valid. Prior to this change, repmgr would complain about an invalid log level if set to this. --- log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/log.c b/log.c index bca86ae5..9ba0eb6a 100644 --- a/log.c +++ b/log.c @@ -112,7 +112,7 @@ logger_init(t_configuration_options * opts, const char *ident, const char *level printf("Assigned level for logger: %d\n", l); #endif - if (l > 0) + if (l >= 0) log_level = l; else stderr_log_warning(_("Invalid log level \"%s\" (available values: DEBUG, INFO, NOTICE, WARNING, ERR, ALERT, CRIT or EMERG)\n"), level); @@ -237,7 +237,7 @@ detect_log_level(const char *level) if (!strcmp(level, "EMERG")) return LOG_EMERG; - return 0; + return -1; } int