diff --git a/repmgr-action-cluster.c b/repmgr-action-cluster.c index b4de8721..2c81a5fd 100644 --- a/repmgr-action-cluster.c +++ b/repmgr-action-cluster.c @@ -336,14 +336,25 @@ do_cluster_show(void) /* emit any warnings */ if (warnings.head != NULL && runtime_options.terse == false && runtime_options.output_mode != OM_CSV) { - ItemListCell *cell = NULL; - printf(_("\nWARNING: following issues were detected\n")); + ItemListCell *cell = NULL; + 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) { log_hint(_("execute with --verbose option to see connection error messages")); diff --git a/repmgr-action-service.c b/repmgr-action-service.c index f8f537e1..b8ea46a1 100644 --- a/repmgr-action-service.c +++ b/repmgr-action-service.c @@ -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) {