diff options
author | Tom Lane | 2020-09-17 16:52:18 +0000 |
---|---|---|
committer | Tom Lane | 2020-09-17 16:52:18 +0000 |
commit | 99175141c9254318e5894ac30b9fdb622612acda (patch) | |
tree | 2afcbc8352aca1296a371c41cc7d3a2a2ccecb3a /src/include/common/logging.h | |
parent | b7f2dd959a5082540adbeee1dea0c0b1c154374f (diff) |
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/[email protected]
Diffstat (limited to 'src/include/common/logging.h')
-rw-r--r-- | src/include/common/logging.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/common/logging.h b/src/include/common/logging.h index 028149c7a15..3205b8fef9b 100644 --- a/src/include/common/logging.h +++ b/src/include/common/logging.h @@ -66,6 +66,7 @@ extern enum pg_log_level __pg_log_level; void pg_logging_init(const char *argv0); void pg_logging_config(int new_flags); void pg_logging_set_level(enum pg_log_level new_level); +void pg_logging_increase_verbosity(void); void pg_logging_set_pre_callback(void (*cb) (void)); void pg_logging_set_locus_callback(void (*cb) (const char **filename, uint64 *lineno)); |