public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nathan Bossart <[email protected]>
Subject: [PATCH 1/1] work-in-progress: fix pg_upgrade output
Date: Wed, 2 Aug 2023 10:20:11 -0700

---
 src/bin/pg_upgrade/util.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/bin/pg_upgrade/util.c b/src/bin/pg_upgrade/util.c
index 21ba4c8f12..bea6d7289d 100644
--- a/src/bin/pg_upgrade/util.c
+++ b/src/bin/pg_upgrade/util.c
@@ -50,10 +50,10 @@ end_progress_output(void)
 	if (log_opts.isatty)
 	{
 		printf("\r");
-		pg_log(PG_REPORT_NONL, "%-*s", MESSAGE_WIDTH, "");
+		pg_log(PG_REPORT_NONL, "%-*s\r  ", MESSAGE_WIDTH, "");
 	}
 	else if (log_opts.verbose)
-		pg_log(PG_REPORT_NONL, "%-*s", MESSAGE_WIDTH, "");
+		pg_log(PG_REPORT_NONL, "  ");
 }
 
 /*
@@ -114,9 +114,6 @@ cleanup_output_dirs(void)
  * prep_status
  *
  *	Displays a message that describes an operation we are about to begin.
- *	We pad the message out to MESSAGE_WIDTH characters so that all of the
- *	"ok" and "failed" indicators line up nicely.  (Overlength messages
- *	will be truncated, so don't get too verbose.)
  *
  *	A typical sequence would look like this:
  *		prep_status("about to flarb the next %d files", fileCount);
@@ -135,8 +132,7 @@ prep_status(const char *fmt,...)
 	vsnprintf(message, sizeof(message), fmt, args);
 	va_end(args);
 
-	/* trim strings */
-	pg_log(PG_REPORT_NONL, "%-*s", MESSAGE_WIDTH, message);
+	pg_log(PG_REPORT_NONL, "%s ... ", message);
 }
 
 /*
@@ -167,9 +163,9 @@ prep_status_progress(const char *fmt,...)
 	 * put the individual progress items onto the next line.
 	 */
 	if (log_opts.isatty || log_opts.verbose)
-		pg_log(PG_REPORT, "%-*s", MESSAGE_WIDTH, message);
+		pg_log(PG_REPORT, "%s ...", message);
 	else
-		pg_log(PG_REPORT_NONL, "%-*s", MESSAGE_WIDTH, message);
+		pg_log(PG_REPORT_NONL, "%s ... ", message);
 }
 
 static void
-- 
2.25.1


--gBBFr7Ir9EOA20Yy--





view thread (6+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [PATCH 1/1] work-in-progress: fix pg_upgrade output
  In-Reply-To: <no-message-id-1853233@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox