From 786da2b089ceabaa567d3170a051eab45a8d37df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Wed, 11 Oct 2023 09:07:52 +0300 Subject: [PATCH] =?UTF-8?q?mdbx-tools:=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20?= =?UTF-8?q?=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=B1=20=D1=83=D1=80=D0=BE=D0=B2=D0=BD=D0=B5=20=D0=B4?= =?UTF-8?q?=D0=B5=D1=82=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D0=B8/ve?= =?UTF-8?q?rbosity.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mdbx_chk.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/mdbx_chk.c b/src/mdbx_chk.c index c590253d..55e6f98d 100644 --- a/src/mdbx_chk.c +++ b/src/mdbx_chk.c @@ -369,7 +369,7 @@ static void usage(char *prog) { "usage: %s " "[-V] [-v] [-q] [-c] [-0|1|2] [-w] [-d] [-i] [-s subdb] [-u|U] dbpath\n" " -V\t\tprint version and exit\n" - " -v\t\tmore verbose, could be repeated upto 9 times\n" + " -v\t\tmore verbose, could be repeated upto 9 times for extra details\n" " -q\t\tbe quiet\n" " -c\t\tforce cooperative mode (don't try exclusive)\n" " -w\t\twrite-mode checking\n" @@ -493,8 +493,14 @@ int main(int argc, char *argv[]) { case 'v': if (verbose >= 9 && 0) usage(prog); - else + else { verbose += 1; + if (verbose == 0 && !MDBX_DEBUG) + printf("Verbosity level %u exposures only to" + " a debug/extra-logging-enabled builds (with NDEBUG undefined" + " or MDBX_DEBUG > 0)\n", + verbose); + } break; case '0': stuck_meta = 0; @@ -604,10 +610,15 @@ int main(int argc, char *argv[]) { envname = argv[optind]; print(MDBX_chk_result, - "mdbx_chk %s (%s, T-%s)\nRunning for %s in 'read-%s' mode...", + "mdbx_chk %s (%s, T-%s)\nRunning for %s in 'read-%s' mode with " + "verbosity level %u (%s)...", mdbx_version.git.describe, mdbx_version.git.datetime, mdbx_version.git.tree, envname, - (env_flags & MDBX_RDONLY) ? "only" : "write"); + (env_flags & MDBX_RDONLY) ? "only" : "write", verbose, + (verbose > 8) + ? (MDBX_DEBUG ? "extra details for debugging" + : "same as 8 for non-debug builds with MDBX_DEBUG=0") + : "of 0..9"); lf_flush(); mdbx_setup_debug((verbose + MDBX_LOG_WARN < MDBX_LOG_TRACE) ? (MDBX_log_level_t)(verbose + MDBX_LOG_WARN)