Re: Unified logging system for command-line programs - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Unified logging system for command-line programs
Date
Msg-id 21141.1546199123@sss.pgh.pa.us
Whole thread Raw
In response to Unified logging system for command-line programs  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: Unified logging system for command-line programs  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: Unified logging system for command-line programs  (Andres Freund <andres@anarazel.de>)
Re: Unified logging system for command-line programs  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> I have developed a patch that unifies the various ad hoc logging
> (message printing, error printing) systems used throughout the
> command-line programs.

I've not read the patch in any detail, but +1 for making this more
uniform.

> - Common files (common/, fe_utils/, etc.) can handle logging much more
> simply by just using one API without worrying too much about the context
> of the calling program, requiring callbacks, or having to pass
> "progname" around everywhere.

It seems like a shame that src/common files still need to have
#ifdef FRONTEND variant code to deal with frontend vs. backend
conventions.  I wonder how hard it would be to layer some subset of
ereport() functionality on top of what you have here, so as to get
rid of those #ifdef stanzas.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: Moving slot restart_lsn/catalog_xmin more eagerly from SQLfunctions
Next
From: Thomas Munro
Date:
Subject: Re: Shared Memory: How to use SYSV rather than MMAP ?