mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Convert printed "WARNING" messages to logging output
In a couple of places ("cluster show" and "service status") we printed
connection status errors as a "WARNING" to stdout, followed by a log
HINT, but the latter was ineffective unless the configured log
level happened to match the level of the most recently emitted log
line (which will most likely be DEBUG).
Convert the printed WARNING lines to an actual log WARNING, to make the
behaviour of this output behave as expected.
This commit is contained in:
@@ -357,11 +357,22 @@ do_service_status(void)
|
||||
{
|
||||
ItemListCell *cell = NULL;
|
||||
|
||||
printf(_("\nWARNING: following issues were detected\n"));
|
||||
PQExpBufferData warning;
|
||||
|
||||
initPQExpBuffer(&warning);
|
||||
|
||||
appendPQExpBufferStr(&warning,
|
||||
_("following issues were detected\n"));
|
||||
|
||||
for (cell = warnings.head; cell; cell = cell->next)
|
||||
{
|
||||
printf(_(" - %s\n"), cell->string);
|
||||
appendPQExpBuffer(&warning,
|
||||
_(" - %s\n"), cell->string);
|
||||
}
|
||||
puts("");
|
||||
log_warning("%s", warning.data);
|
||||
|
||||
termPQExpBuffer(&warning);
|
||||
|
||||
if (runtime_options.verbose == false && connection_error_found == true)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user