Re: Frontend error logging style
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>,
Andres Freund <andres@anarazel.de>,
Robert Haas <robertmhaas@gmail.com>,
Michael Paquier <michael@paquier.xyz>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-04-08T19:05:25Z
Lists: pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes: > On 30 Mar 2022, at 00:38, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> Feel free to work on a followup editing patch though. > Thats my plan, once this lands I'll rebase the comments on top of your work and > we can have a separate discussion around them then. The main patch is pushed now. I addressed the complaint Peter had about the messages with "Check your installation" pseudo-hints by getting rid of them; I concur with your observation that those hints were basically useless. I also fixed the one place where the message should clearly be "could not close" not "could not write". Mostly didn't yield to temptation anywhere else. One other loose end is bothering me: I stuck with logging.h's original choice to put "if (likely())" or "if (unlikely())" conditionals into the macros, but I rather suspect that that's just a waste. 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. regards, tom lane
Commits
-
logging: Also add the command prefix to detail and hint messages
- a8cca6026e99 15.0 landed
-
Remove not-very-useful early checks of __pg_log_level in logging.h.
- 2c9381840fe2 15.0 landed
-
Improve frontend error logging style.
- 9a374b77fb53 15.0 landed
-
Apply PGDLLIMPORT markings broadly.
- 8ec569479fc2 15.0 cited