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

From Peter Eisentraut
Subject Re: Unified logging system for command-line programs
Date
Msg-id 841dd9fb-3550-dce0-e9ff-8f64cac9f15d@2ndquadrant.com
Whole thread Raw
In response to Re: Unified logging system for command-line programs  (Andres Freund <andres@anarazel.de>)
Responses Re: Unified logging system for command-line programs  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 31/12/2018 16:55, Andres Freund wrote:
> I think we should aim to unify the use (in contrast to the
> implementation) of logging as much as possible, rather than having a
> separate API for it for client programs.

I opted against doing that, for mainly two reasons: One, I think the
ereport() API is too verbose for this purpose, an invocation is usually
two to three lines.  My goal was to make logging smaller and more
compact.  Two, I think tying error reporting to flow control does not
always work well and leads to bad code and a bad user experience.
Relatedly, rewriting all the frontend programs to exception style would
end up being a 10x project to rewrite everything for no particular
benefit.  Going from 8 or so APIs to 2 is already an improvement, I
think.  If someone wants to try going further, it can be considered, but
it would be an entirely different project.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Unified logging system for command-line programs
Next
From: Tomas Vondra
Date:
Subject: Re: Delay locking partitions during query execution