Re: convert elog(LOG) calls to ereport

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: convert elog(LOG) calls to ereport
Date: 2020-12-02 14:04:45
Message-ID: 20201202140445.GA26406@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-Dec-02, Peter Eisentraut wrote:

> There are a number of elog(LOG) calls that appear to be user-facing, so they
> should be ereport()s. This patch changes them. There are more elog(LOG)
> calls remaining, but they all appear to be some kind of debugging support.
> Also, I changed a few elog(FATAL)s that were nearby, but I didn't
> specifically look for them.

> - elog(LOG, "WSAIoctl(SIO_KEEPALIVE_VALS) failed: %ui",
> - WSAGetLastError());
> + ereport(LOG,
> + (errmsg("WSAIoctl(SIO_KEEPALIVE_VALS) failed: %ui",
> + WSAGetLastError())));

Please take the opportunity to move the flag name out of the message in
this one, also. I do wonder if it'd be a good idea to move the syscall
name itself out of the message, too; that would reduce the number of
messages to translate 50x to just "%s(%s) failed: %m" instead of one
message per distinct syscall.

Should fd.c messages do errcode_for_file_access() like elsewhere?

Overall, it looks good to me.

Thanks

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message yuzuko 2020-12-02 14:11:16 Re: Autovacuum on partitioned table (autoanalyze)
Previous Message Alvaro Herrera 2020-12-02 13:49:19 Re: wrong link in acronyms.sgml