pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve common/logging.c's support for multiple verbosity levels
Date: Thu, 17 Sep 2020 16:52:24 +0000
Message-ID: <E1kIx8y-0006O8-4N@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/99175141c9254318e5894ac30b9fdb622612acda

Modified Files
--------------
doc/src/sgml/ref/pg_dump.sgml                 |  2 ++
doc/src/sgml/ref/pg_dumpall.sgml              |  4 +++-
doc/src/sgml/ref/pg_restore.sgml              |  7 ++++++-
src/bin/pg_archivecleanup/pg_archivecleanup.c |  2 +-
src/bin/pg_dump/pg_backup_archiver.c          |  3 ++-
src/bin/pg_dump/pg_dump.c                     |  2 +-
src/bin/pg_dump/pg_dumpall.c                  |  2 +-
src/bin/pg_dump/pg_restore.c                  |  2 +-
src/bin/pg_rewind/pg_rewind.c                 |  2 +-
src/bin/pgbench/pgbench.c                     |  2 +-
src/common/logging.c                          | 18 ++++++++++++++++++
src/include/common/logging.h                  |  1 +
12 files changed, 38 insertions(+), 9 deletions(-)



Message-ID: <E1kIx8y-0006O8-4N@gemulon.postgresql.org>
Permalink:  ../E1kIx8y-0006O8-4N@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kIx8y-0006O8-4N@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Improve common/logging.c's support for multiple verbosity levels
  In-Reply-To: <E1kIx8y-0006O8-4N@gemulon.postgresql.org>
  References: <E1kIx8y-0006O8-4N@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox