diff options
author | Vladimír Čunát <vladimir.cunat@nic.cz> | 2016-12-07 13:53:43 +0100 |
---|---|---|
committer | Vladimír Čunát <vladimir.cunat@nic.cz> | 2016-12-07 13:53:43 +0100 |
commit | 074257f5d8e0a71a151ccee4d796b760d1ba1e4e (patch) | |
tree | 69f25a7c969c83c213cde3cd095ec96228984416 /daemon | |
parent | build docs: mention -DNDEBUG, to be sure (diff) | |
download | knot-resolver-074257f5d8e0a71a151ccee4d796b760d1ba1e4e.tar.xz knot-resolver-074257f5d8e0a71a151ccee4d796b760d1ba1e4e.zip |
--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`.
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/README.rst | 2 | ||||
-rw-r--r-- | daemon/main.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/daemon/README.rst b/daemon/README.rst index 5d87ded0..61a8965c 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 e0af3754..da447c05 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; |