Re: Frontend error logging style

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Frontend error logging style
Date: 2022-04-12 18:56:13
Message-ID: 906958.1649789773@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> writes:
> On 11.04.22 17:22, Tom Lane wrote:
>> 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.

> Oh, that's right, the whole thing is to not evaluate the arguments if
> the log level isn't adequate. We should probably keep that.

I don't think that's nearly as interesting in the frontend as in
the backend. Error messages in the backend frequently include
catalog lookups and the like in the arguments, but I think nearly
all frontend messages are writing nothing more complicated than
variables and maybe some indirections or array fetches. So I'm
not all that worried about runtime, and would rather save some
code space.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-04-12 19:05:22 Re: failures in t/031_recovery_conflict.pl on CI
Previous Message Andres Freund 2022-04-12 18:49:13 Re: failures in t/031_recovery_conflict.pl on CI