Skipping useless ereport/elog calls.
authorMuhammad Usama <m.usama@gmail.com>
Tue, 31 May 2022 11:19:31 +0000 (16:19 +0500)
committerMuhammad Usama <m.usama@gmail.com>
Tue, 31 May 2022 11:31:45 +0000 (16:31 +0500)
commit5a0d28309da96b65d142e10d5f22485518e89a08
tree5116dab81f96be138c50fd50ef7e536f072ac81d
parent050be475d738ab4f8268dce21e2e5361b7dbcbee
Skipping useless ereport/elog calls.

Although ereport() and elog() themselves are quite cheap when the error message
level is too low to be printed, some places need to do substantial work before
they can call those macros at all. message_level_is_interesting() can be handy
to allow optimizing away such setup work when nothing is to be printed.

Function message_level_is_interesting(elevel) is borrowed from PostgreSQL
source that reports whether ereport/elog will do anything.
src/context/pool_session_context.c
src/include/utils/elog.h
src/utils/error/elog.c
src/utils/pool_stream.c
src/utils/socket_stream.c
src/watchdog/watchdog.c