Re: pgbench - use pg logging capabilities - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pgbench - use pg logging capabilities
Date
Msg-id 20200107082426.GK2386@paquier.xyz
Whole thread Raw
In response to Re: pgbench - use pg logging capabilities  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: pgbench - use pg logging capabilities  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers
On Mon, Jan 06, 2020 at 01:36:23PM +0100, Fabien COELHO wrote:
>> I think that I would just remove the "debug" variable defined in
>> pgbench.c all together, and switch the messages for the duration and the
>> one in executeMetaCommand to use info-level logging..
>
> Ok, done.

Thanks.  The output then gets kind of inconsistent when using --debug:
pgbench: client 2 executing script "<builtin: TPC-B (sort of)>"
client 2 executing \set aid
client 2 executing \set bid
client 2 executing \set tid
client 2 executing \set delta

My point was to just modify the code so as this uses pg_log_debug(),
with a routine doing some reverse-engineering of the Command data to
generate a  string to show up in the logs.  Sorry for the confusion..
And there is no need to use __pg_log_level either which should remain
internal to logging.h IMO.

We'd likely want a similar business in syntax_error() to be fully
consistent with all other code paths dealing with an error showing up
before exiting.

No idea what others think here.  I may be too much pedantic.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: table partitioning and access privileges
Next
From: Fabien COELHO
Date:
Subject: Re: pgbench - use pg logging capabilities