Re: Frontend error logging style - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Frontend error logging style
Date
Msg-id 274816.1649690560@sss.pgh.pa.us
Whole thread Raw
In response to Re: Frontend error logging style  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Responses Re: Frontend error logging style  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
List pgsql-hackers
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
> On 08.04.22 22:26, Tom Lane wrote:
>>> I think we should put a centralized level check
>>> into logging.c, and get rid of at least the "if (likely())"
>>> checks, because those are going to succeed approximately 100.0%
>>> of the time.  Maybe there's an argument for keeping the unlikely()
>>> ones.

> Yeah, that seems ok to change.  The previous coding style is more useful 
> if you have a lot of debug messages in a hot code path, but that usually 
> doesn't apply to where this is used.

The patch I presented keeps the unlikely() checks in the debug-level
macros.  Do you think we should drop those too?  I figured that avoiding
evaluating the arguments would be worth something.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Zhihong Yu
Date:
Subject: Re: CLUSTER on partitioned index
Next
From: Julien Rouhaud
Date:
Subject: Re: Schema variables - new implementation for Postgres 15+1