Re: Frontend error logging style

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Michael Paquier <michael@paquier.xyz>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-11-19T15:18:55Z
Lists: pgsql-hackers
On Fri, Nov 19, 2021 at 5:17 AM Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
> If people want to do that kind of thing (I'm undecided whether the
> complexity is worth it), then make it a different API.  The pg_log_*
> calls are for writing formatted output.  They normalized existing
> hand-coded patterns at the time.  We can wrap another API on top of them
> that does flow control and output.  The pg_log_* stuff is more on the
> level of syslog(), which also just outputs stuff.  Nobody is suggesting
> that syslog(LOG_EMERG) should exit the program automatically.  But you
> can wrap higher-level APIs such as ereport() on top of that that might
> do that.

Yeah, that might be a way forward.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



Commits

  1. logging: Also add the command prefix to detail and hint messages

  2. Remove not-very-useful early checks of __pg_log_level in logging.h.

  3. Improve frontend error logging style.

  4. Apply PGDLLIMPORT markings broadly.