elog: clarify usage and style of error reporting functions - Mailing list pgsql-hackers

From Chao Li
Subject elog: clarify usage and style of error reporting functions
Date
Msg-id 39976911-5A4B-4C52-844B-6FF397CECC8F@gmail.com
Whole thread Raw
List pgsql-hackers
Hi,

This came up while reviewing a patch [1], where Tom pointed out the difference between elog() and ereport() and
referencedthe corresponding documentation [2]. While doing patch reviews, I have also noticed many inconsistencies in
thestyle of detail and hint messages. Even in the current code base, these inconsistencies are quite common. The
PostgreSQLdocumentation [3] already provides guidelines for writing such messages. 

For these logging functions, developers are more likely to read the function header comments than the external
documentation,so it seems useful to include brief guidelines directly in the code. 

This patch adds short style guidelines to the relevant logging functions.

[1] https://postgr.es/m/297458.1772811905@sss.pgh.pa.us
[2] https://www.postgresql.org/docs/devel/error-message-reporting.html
[3] https://www.postgresql.org/docs/current/error-style-guide.html

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/




Attachment

pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: POC: make mxidoff 64 bits
Next
From: Amit Kapila
Date:
Subject: Re: Skipping schema changes in publication