1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Improve common/logging.c's support for multiple verbosity levels.

Instead of hard-wiring specific verbosity levels into the option
processing of client applications, invent pg_logging_increase_verbosity()
and encourage clients to implement --verbose by calling that.  Then,
the common convention that more -v's gets you more verbosity just works.

In particular, this allows resurrection of the debug-grade messages that
have long existed in pg_dump and its siblings.  They were unreachable
before this commit due to lack of a way to select PG_LOG_DEBUG logging
level.  (It appears that they may have been unreachable for some time
before common/logging.c was introduced, too, so I'm not specifically
blaming cc8d41511 for the oversight.  One reason for thinking that is
that it's now apparent that _allocAH()'s message needs a null-pointer
guard.  Testing might have failed to reveal that before 96bf88d52.)

Discussion: https://postgr.es/m/1173106.1600116625@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2020-09-17 12:52:18 -04:00
parent b7f2dd959a
commit 99175141c9
12 changed files with 38 additions and 9 deletions

View File

@ -594,6 +594,8 @@ PostgreSQL documentation
<application>pg_dump</application> to output detailed object
comments and start/stop times to the dump file, and progress
messages to standard error.
Repeating the option causes additional debug-level messages
to appear on standard error.
</para>
</listitem>
</varlistentry>

View File

@ -202,7 +202,9 @@ PostgreSQL documentation
Specifies verbose mode. This will cause
<application>pg_dumpall</application> to output start/stop
times to the dump file, and progress messages to standard error.
It will also enable verbose output in <application>pg_dump</application>.
Repeating the option causes additional debug-level messages
to appear on standard error.
The option is also passed down to <application>pg_dump</application>.
</para>
</listitem>
</varlistentry>

View File

@ -483,7 +483,12 @@ PostgreSQL documentation
<term><option>--verbose</option></term>
<listitem>
<para>
Specifies verbose mode.
Specifies verbose mode. This will cause
<application>pg_restore</application> to output detailed object
comments and start/stop times to the output file, and progress
messages to standard error.
Repeating the option causes additional debug-level messages
to appear on standard error.
</para>
</listitem>
</varlistentry>