From 5773c75b58bab36bfe4f83cecffc2de9ff1faa7b Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Wed, 17 Apr 2013 17:47:44 +0100 Subject: [PATCH] Using elog instead of printf to report what database we are on I know the ... is pretty but it messes up with warnings etc. By the way there was a \n so the skipped part wasn't even going on the same line. --- bin/pg_repack.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/bin/pg_repack.c b/bin/pg_repack.c index d40a953..681fa44 100644 --- a/bin/pg_repack.c +++ b/bin/pg_repack.c @@ -365,22 +365,10 @@ repack_all_databases(const char *orderby) dbname = PQgetvalue(result, i, 0); - if (pgut_log_level >= INFO) - { - printf("%s: repack database \"%s\"\n", PROGRAM_NAME, dbname); - fflush(stdout); - } - + elog(INFO, "repacking database \"%s\"", dbname); ret = repack_one_database(orderby, errbuf, sizeof(errbuf)); - - if (pgut_log_level >= INFO) - { - if (ret) - printf("\n"); - else - printf(" ... skipped: %s\n", errbuf); - fflush(stdout); - } + if (!ret) + elog(INFO, "database \"%s\" skipped: %s", dbname, errbuf); } CLEARPGRES(result);