Re: pgbench - use pg logging capabilities
Fabien COELHO <coelho@cri.ensmp.fr>
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Michael Paquier <michael@paquier.xyz>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2020-01-09T09:28:21Z
Lists: pgsql-hackers
Attachments
- pgbench-logs-2.patch (text/x-diff) patch
- pgbench-log-level-1.patch (text/x-diff) patch
Bonjour Michaël, >> I don't follow what you mean by that. > > The first versions of the patch did not change syntax_error(), and the > version committed has switched to use PQExpBufferData there. I think > that we should just do the same for the debug logs executing the meta > commands. This way, we get an output consistent with what's printed > out for sending or receiving stuff. Please see the attached. Yep, I thought of it, but I was not very keen on having a malloc/free cycle just for one debug message. However under debug this is probably not an issue. Your patch works for me. IT can avoid some level of format interpretation overheads by switching to Char/Str functions, see first attachement. The other point is the test on __pg_log_level, see second attached. -- Fabien.
Commits
-
pgbench: Make more debug messages use common logging API
- 39a5f2a94f8a 13.0 landed
-
pgbench: Use common logging API
- 30a3e772b401 13.0 landed