]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
--verbose: warn when having no effect
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 7 Dec 2016 12:53:43 +0000 (13:53 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 7 Dec 2016 12:53:43 +0000 (13:53 +0100)
... 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`.

daemon/README.rst
daemon/main.c

index 5d87ded023683d24a3121f3e70ab9bb47696e265..61a8965cb740b738e12184e3597c86c5ba5fc8d1 100644 (file)
@@ -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
index e0af375476dcfdb6befb905a45ff16545c8f9994..da447c05b33e06e5ef4a19e7da66cd2e0bf15c42 100644 (file)
@@ -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;