pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: convert elog(LOG) calls to ereport
Date: Wed, 2 Dec 2020 11:04:45 -0300
Message-ID: <20201202140445.GA26406@alvherre.pgsql> (raw)
In-Reply-To: <92d6f545-5102-65d8-3c87-489f71ea0a37@enterprisedb.com>

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






view thread (9+ messages)  latest in thread

Message-ID: <20201202140445.GA26406@alvherre.pgsql>
Permalink:  ../20201202140445.GA26406@alvherre.pgsql/
Also on:    postgresql.org/message-id/20201202140445.GA26406@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, peter.eisentraut@enterprisedb.com
  Subject: Re: convert elog(LOG) calls to ereport
  In-Reply-To: <20201202140445.GA26406@alvherre.pgsql>
  References: <92d6f545-5102-65d8-3c87-489f71ea0a37@enterprisedb.com> <20201202140445.GA26406@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox