summaryrefslogtreecommitdiff
path: root/src/nls-global.mk
diff options
context:
space:
mode:
authorTom Lane2022-04-08 18:55:14 +0000
committerTom Lane2022-04-08 18:55:14 +0000
commit9a374b77fb53e4cfbca121e4fa278a7d71bde7c4 (patch)
tree6591af757bd9df12549279b4b87f01e0ce98bd79 /src/nls-global.mk
parent5c431c7fb327e1abc70b7a197650f8d45fd5bede (diff)
Improve frontend error logging style.
Get rid of the separate "FATAL" log level, as it was applied so inconsistently as to be meaningless. This mostly involves s/pg_log_fatal/pg_log_error/g. Create a macro pg_fatal() to handle the common use-case of pg_log_error() immediately followed by exit(1). Various modules had already invented either this or equivalent macros; standardize on pg_fatal() and apply it where possible. Invent the ability to add "detail" and "hint" messages to a frontend message, much as we have long had in the backend. Except where rewording was needed to convert existing coding to detail/hint style, I have (mostly) resisted the temptation to change existing message wording. Patch by me. Design and patch reviewed at various stages by Robert Haas, Kyotaro Horiguchi, Peter Eisentraut and Daniel Gustafsson. Discussion: https://postgr.es/m/1363732.1636496441@sss.pgh.pa.us
Diffstat (limited to 'src/nls-global.mk')
-rw-r--r--src/nls-global.mk10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nls-global.mk b/src/nls-global.mk
index 53129f0a04..c1f7982300 100644
--- a/src/nls-global.mk
+++ b/src/nls-global.mk
@@ -72,10 +72,16 @@ BACKEND_COMMON_GETTEXT_FLAGS = \
FRONTEND_COMMON_GETTEXT_FILES = $(top_srcdir)/src/common/logging.c
FRONTEND_COMMON_GETTEXT_TRIGGERS = \
- pg_log_fatal pg_log_error pg_log_warning pg_log_info pg_log_generic:2 pg_log_generic_v:2
+ pg_log_error pg_log_error_detail pg_log_error_hint \
+ pg_log_warning pg_log_warning_detail pg_log_warning_hint \
+ pg_log_info pg_log_info_detail pg_log_info_hint \
+ pg_fatal pg_log_generic:3 pg_log_generic_v:3
FRONTEND_COMMON_GETTEXT_FLAGS = \
- pg_log_fatal:1:c-format pg_log_error:1:c-format pg_log_warning:1:c-format pg_log_info:1:c-format pg_log_generic:2:c-format pg_log_generic_v:2:c-format
+ pg_log_error:1:c-format pg_log_error_detail:1:c-format pg_log_error_hint:1:c-format \
+ pg_log_warning:1:c-format pg_log_warning_detail:1:c-format pg_log_warning_hint:1:c-format \
+ pg_log_info:1:c-format pg_log_info_detail:1:c-format pg_log_info_hint:1:c-format \
+ pg_fatal:1:c-format pg_log_generic:3:c-format pg_log_generic_v:3:c-format
all-po: $(MO_FILES)