Re: pgsql: Convert debug message from ereport to elog

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Convert debug message from ereport to elog
Date: 2018-06-28 08:27:18
Message-ID: 50847dd2-10c1-cda6-2941-167dda9e23ff@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On 6/15/18 06:53, Tatsuo Ishii wrote:
> Therefore, elog should be used only for internal errors and low-level
> debug logging. Also for these purposes ereport should not be used.

ereport() has the advantage that if the debug level excludes the
message, then the errmsg() call won't even be run and therefore the
message doesn't have to be computed. So actually ereport() is
preferable in many cases for debug messages.

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

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2018-06-28 13:12:18 pgsql: doc: backpatch mention use of cross platform logical replication
Previous Message Alvaro Herrera 2018-06-27 19:42:54 pgsql: Fix typo in comment