From: Vladimír Čunát Date: Wed, 7 Dec 2016 12:53:43 +0000 (+0100) Subject: --verbose: warn when having no effect X-Git-Tag: v1.2.0-rc1~64^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=074257f5d8e0a71a151ccee4d796b760d1ba1e4e;p=thirdparty%2Fknot-resolver.git --verbose: warn when having no effect ... but don't raise any kind of error. The lua function `verbose()` behaved reasonably already. It doesn't warn, but docs for the function do mention `NLOGDEBUG`. --- diff --git a/daemon/README.rst b/daemon/README.rst index 5d87ded02..61a8965cb 100644 --- a/daemon/README.rst +++ b/daemon/README.rst @@ -73,7 +73,7 @@ The daemon features a CLI interface, type ``help()`` to see the list of availabl Verbose output -------------- -If the debug logging is compiled in, you can turn on verbose tracing of server operation with the ``-v`` option. +If the debug logging is compiled in, i.e. not turned off by ``-DNLOGDEBUG``, you can turn on verbose tracing of server operation with the ``-v`` option. You can also toggle it on runtime with ``verbose(true|false)`` command. .. code-block:: bash diff --git a/daemon/main.c b/daemon/main.c index e0af37547..da447c05b 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -298,7 +298,11 @@ static void help(int argc, char *argv[]) " -k, --keyfile=[path] File containing trust anchors (DS or DNSKEY).\n" " -f, --forks=N Start N forks sharing the configuration.\n" " -q, --quiet Quiet output, no prompt in interactive mode.\n" - " -v, --verbose Run in verbose mode.\n" + " -v, --verbose Run in verbose mode." +#ifdef NLOGDEBUG + " (Recompile without -DNLOGDEBUG to activate.)" +#endif + "\n" " -V, --version Print version of the server.\n" " -h, --help Print help and usage.\n" "Options:\n" @@ -456,6 +460,9 @@ int main(int argc, char **argv) break; case 'v': kr_debug_set(true); +#ifdef NLOGDEBUG + kr_log_info("--verbose flag has no effect due to compilation with -DNLOGDEBUG.\n"); +#endif break; case 'q': g_quiet = true;