mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 15:16:29 +00:00
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.
This commit is contained in:
4
log.c
4
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
|
||||
|
||||
Reference in New Issue
Block a user