aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2020-01-10 09:02:25 +0900
committerMichael Paquier <michael@paquier.xyz>2020-01-10 09:02:25 +0900
commit39a5f2a94f8a3bcfdb3da7391427a63f8f88b210 (patch)
treedf9c68ab041d915695cae7f89fc0648a9592b667 /src
parente7ee433137b6eb3678deeebc68be53d58aa1e5d3 (diff)
downloadpostgresql-39a5f2a94f8a3bcfdb3da7391427a63f8f88b210.tar.gz
postgresql-39a5f2a94f8a3bcfdb3da7391427a63f8f88b210.zip
pgbench: Make more debug messages use common logging API
This is a follow-up of 30a3e772, making the output more consistent when using --debug for meta-command execution. Author: Michael Paquier Reviewed-by: Fabien Coelho Discussion: https://postgr.es/m/alpine.DEB.2.21.1912241100390.3339@pseudo
Diffstat (limited to 'src')
-rw-r--r--src/bin/pgbench/pgbench.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index ee1134aea2f..39c1a243d53 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -3297,10 +3297,17 @@ executeMetaCommand(CState *st, instr_time *now)
if (unlikely(__pg_log_level <= PG_LOG_DEBUG))
{
- fprintf(stderr, "client %d executing \\%s", st->id, argv[0]);
+ PQExpBufferData buf;
+
+ initPQExpBuffer(&buf);
+
+ printfPQExpBuffer(&buf, "client %d executing \\%s", st->id, argv[0]);
for (int i = 1; i < argc; i++)
- fprintf(stderr, " %s", argv[i]);
- fprintf(stderr, "\n");
+ appendPQExpBuffer(&buf, " %s", argv[i]);
+
+ pg_log_debug("%s", buf.data);
+
+ termPQExpBuffer(&buf);
}
if (command->meta == META_SLEEP)