pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Convert debug message from ereport to elog
5+ messages / 3 participants
[nested] [flat]

* pgsql: Convert debug message from ereport to elog
@ 2018-06-12 15:36  Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Peter Eisentraut @ 2018-06-12 15:36 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Convert debug message from ereport to elog

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8a07ebb3c172374aa2c83df61c4e05c059511c9a

Modified Files
--------------
src/backend/replication/logical/worker.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Convert debug message from ereport to elog
@ 2018-06-13 00:13  Tatsuo Ishii <ishii@sraoss.co.jp>
  parent: Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Tatsuo Ishii @ 2018-06-13 00:13 UTC (permalink / raw)
  To: peter_e@gmx.net; +Cc: pgsql-committers@lists.postgresql.org

Just out of curiosity, what is the reason why you did this?  I guess
using elog instead of ereport for debugging message is preferable,
while for non debugging messages using ereport is preferable, but
actually sometimes elog is used for error messages in the file.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

From: Peter Eisentraut <peter_e@gmx.net>
Subject: pgsql: Convert debug message from ereport to elog
Date: Tue, 12 Jun 2018 15:36:49 +0000
Message-ID: <E1fSlLl-0001W4-Me@gemulon.postgresql.org>

> Convert debug message from ereport to elog
> 
> Branch
> ------
> master
> 
> Details
> -------
> https://git.postgresql.org/pg/commitdiff/8a07ebb3c172374aa2c83df61c4e05c059511c9a
> 
> Modified Files
> --------------
> src/backend/replication/logical/worker.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Convert debug message from ereport to elog
@ 2018-06-15 04:24  Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  parent: Tatsuo Ishii <ishii@sraoss.co.jp>
  0 siblings, 1 reply; 5+ messages in thread

From: Peter Eisentraut @ 2018-06-15 04:24 UTC (permalink / raw)
  To: Tatsuo Ishii <ishii@sraoss.co.jp>; +Cc: pgsql-committers@lists.postgresql.org

> Just out of curiosity, what is the reason why you did this?  I guess

This made a message consistent with an analogous message in
apply_handle_update() earlier in the file.

> using elog instead of ereport for debugging message is preferable,
> while for non debugging messages using ereport is preferable, but
> actually sometimes elog is used for error messages in the file.

I think this is not done perfectly consistently, and there are
possibilities for improvement.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Convert debug message from ereport to elog
@ 2018-06-15 04:53  Tatsuo Ishii <ishii@sraoss.co.jp>
  parent: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Tatsuo Ishii @ 2018-06-15 04:53 UTC (permalink / raw)
  To: peter.eisentraut@2ndquadrant.com; +Cc: pgsql-committers@lists.postgresql.org

Peter,

>> Just out of curiosity, what is the reason why you did this?  I guess
> 
> This made a message consistent with an analogous message in
> apply_handle_update() earlier in the file.
> 
>> using elog instead of ereport for debugging message is preferable,
>> while for non debugging messages using ereport is preferable, but
>> actually sometimes elog is used for error messages in the file.
> 
> I think this is not done perfectly consistently, and there are
> possibilities for improvement.

Thanks for the explanation. Probably we want add/change something to
"54.2. Reporting Errors Within the Server" In this section I see:

There is an older function elog that is still heavily used. An elog call:
:
:
Therefore, elog should be used only for internal errors and low-level debug logging.



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Convert debug message from ereport to elog
@ 2018-06-28 08:27  Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  parent: Tatsuo Ishii <ishii@sraoss.co.jp>
  0 siblings, 0 replies; 5+ messages in thread

From: Peter Eisentraut @ 2018-06-28 08:27 UTC (permalink / raw)
  To: Tatsuo Ishii <ishii@sraoss.co.jp>; +Cc: pgsql-committers@lists.postgresql.org

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




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2018-06-28 08:27 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12 15:36 pgsql: Convert debug message from ereport to elog Peter Eisentraut <peter_e@gmx.net>
2018-06-13 00:13 ` Tatsuo Ishii <ishii@sraoss.co.jp>
2018-06-15 04:24   ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2018-06-15 04:53     ` Tatsuo Ishii <ishii@sraoss.co.jp>
2018-06-28 08:27       ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

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