Re: Unified logging system for command-line programs

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unified logging system for command-line programs
Date: 2019-01-03 22:08:01
Message-ID: 20190103220801.pi234uthwjguwrt3@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2019-01-03 17:03:43 -0500, Tom Lane wrote:
> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
> > On 03/01/2019 22:01, Tom Lane wrote:
> >> while ereport(ERROR) has the
> >> effect of writing a message and then calling exit(1).
>
> > The problem is that in majority of cases the FRONTEND code, as it is
> > written today, doesn't want to exit() after an error.
>
> Right, so for that you'd use ereport(WARNING) or LOG or whatever.

Or we could just add an ERROR variant that doesn't exit. Years back
I'd proposed that we make the log level a bitmask, but it could also
just be something like CALLSITE_ERROR or something roughly along those
lines. There's a few cases in backend code where that'd be beneficial
too.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Heath 2019-01-03 22:22:27 Custom text type for title text
Previous Message Tom Lane 2019-01-03 22:03:43 Re: Unified logging system for command-line programs