Re: Frontend error logging style

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Frontend error logging style
Дата
Msg-id 632f02ed-12ac-b91f-0e99-9c1b086f8cd0@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Frontend error logging style  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Frontend error logging style  (Robert Haas <robertmhaas@gmail.com>)
Re: Frontend error logging style  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 10.11.21 16:28, Robert Haas wrote:
> What I think we ought
> to be driving towards is having pg_log_fatal() forcibly exit, and
> pg_log_error() do the same unless the error is somehow caught.

This is specifically designed not to do any flow control.  In the 
backend, we have many instances, where log messages are issued with the 
wrong log level because the stronger log level would have flow control 
impact that is not appropriate at the call site.  I don't think we want 
more of that, especially since the flow control requirements in the 
varied suite of frontend programs is quite diverse.  Moreover, we also 
require control over the exit codes in some cases, which this kind of 
API wouldn't allow.

Several programs wrap, say, pg_log_fatal() into a pg_fatal(), that does 
logging, cleanup, and exit, as the case may be.  I think that's a good 
solution.  If someone wanted to write a more widely reusable pg_fatal(), 
why not, but in my previous attempts, this was quite complicated and 
didn't turn out to be useful.




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Test::More version
Следующее
От: Robert Haas
Дата:
Сообщение: Re: refactoring basebackup.c