Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 39a5f2a

Browse files
committed
pgbench: Make more debug messages use common logging API
This is a follow-up of 30a3e77, 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
1 parent e7ee433 commit 39a5f2a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/bin/pgbench/pgbench.c

+10-3
Original file line numberDiff line numberDiff line change
@@ -3297,10 +3297,17 @@ executeMetaCommand(CState *st, instr_time *now)
32973297

32983298
if (unlikely(__pg_log_level <= PG_LOG_DEBUG))
32993299
{
3300-
fprintf(stderr, "client %d executing \\%s", st->id, argv[0]);
3300+
PQExpBufferData buf;
3301+
3302+
initPQExpBuffer(&buf);
3303+
3304+
printfPQExpBuffer(&buf, "client %d executing \\%s", st->id, argv[0]);
33013305
for (int i = 1; i < argc; i++)
3302-
fprintf(stderr, " %s", argv[i]);
3303-
fprintf(stderr, "\n");
3306+
appendPQExpBuffer(&buf, " %s", argv[i]);
3307+
3308+
pg_log_debug("%s", buf.data);
3309+
3310+
termPQExpBuffer(&buf);
33043311
}
33053312

33063313
if (command->meta == META_SLEEP)

0 commit comments

Comments
 (0)