Re: pgbench - use pg logging capabilities

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2020-01-10T00:45:46Z
Lists: pgsql-hackers
On Thu, Jan 09, 2020 at 09:27:42PM -0300, Alvaro Herrera wrote:
> On 2020-Jan-09, Fabien COELHO wrote:
>> -	if (unlikely(__pg_log_level <= PG_LOG_DEBUG))
>> +	if (pg_log_debug_level)
>>  	{
> 
> Umm ... I find the original exceedingly ugly, but the new line is
> totally impenetrable.

Maybe just a pg_logging_get_level() for consistency with the
_set_level() one, and then compare the returned result with
PG_LOG_DEBUG in pgbench?
--
Michael

Commits

  1. pgbench: Make more debug messages use common logging API

  2. pgbench: Use common logging API