Improve common/logging.c's support for multiple verbosity levels.
Tom Lane <tgl@sss.pgh.pa.us>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/pg_dumpall.sgml | modified | +3 −1 |
| doc/src/sgml/ref/pg_dump.sgml | modified | +2 −0 |
| doc/src/sgml/ref/pg_restore.sgml | modified | +6 −1 |
| src/bin/pg_archivecleanup/pg_archivecleanup.c | modified | +1 −1 |
| src/bin/pgbench/pgbench.c | modified | +1 −1 |
| src/bin/pg_dump/pg_backup_archiver.c | modified | +2 −1 |
| src/bin/pg_dump/pg_dumpall.c | modified | +1 −1 |
| src/bin/pg_dump/pg_dump.c | modified | +1 −1 |
| src/bin/pg_dump/pg_restore.c | modified | +1 −1 |
| src/bin/pg_rewind/pg_rewind.c | modified | +1 −1 |
| src/common/logging.c | modified | +18 −0 |
| src/include/common/logging.h | modified | +1 −0 |
Documentation touched
Discussion
- "Unified logging system" breaks access to pg_dump debug outputs 4 messages · 2020-09-14 → 2020-09-17