]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: add getVerbose() function
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 23 May 2022 10:10:28 +0000 (12:10 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 23 May 2022 10:10:28 +0000 (12:10 +0200)
pdns/dnsdist-console.cc
pdns/dnsdist-lua.cc
pdns/dnsdistdist/docs/reference/config.rst

index acca971812cece99962ffc17f1b9b0f18e5a95dc..7b2c96222ab01eaf79be714742440ab0f76a487b 100644 (file)
@@ -538,6 +538,7 @@ const std::vector<ConsoleKeyword> g_consoleKeywords{
   { "getTLSContext", true, "n", "returns the TLS context with index n" },
   { "getTLSFrontend", true, "n", "returns the TLS frontend with index n" },
   { "getTLSFrontendCount", true, "", "returns the number of DoT listeners" },
+  { "getVerbose", true, "", "get whether log messages at the verbose level will be logged" },
   { "grepq", true, "Netmask|DNS Name|100ms|{\"::1\", \"powerdns.com\", \"100ms\"} [, n]", "shows the last n queries and responses matching the specified client address or range (Netmask), or the specified DNS Name, or slower than 100ms" },
   { "hashPassword", true, "password [, workFactor]", "Returns a hashed and salted version of the supplied password, usable with 'setWebserverConfig()'"},
   { "HTTPHeaderRule", true, "name, regex", "matches DoH queries with a HTTP header 'name' whose content matches the regular expression 'regex'"},
index da85a9bc9cde5da2615f6768decb98f39b480b86..a2f2fac7c6d8484b19480a66836c2a8144805db0 100644 (file)
@@ -1718,6 +1718,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
   });
 
   luaCtx.writeFunction("setVerbose", [](bool verbose) { g_verbose = verbose; });
+  luaCtx.writeFunction("getVerbose", []() { return g_verbose; });
   luaCtx.writeFunction("setVerboseHealthChecks", [](bool verbose) { g_verboseHealthChecks = verbose; });
 
   luaCtx.writeFunction("setStaleCacheEntriesTTL", [](uint64_t ttl) {
index 293b06055919c152b146e35eabeb6edf745a5147..6bf11924d58290a0151411a12975498bd64d8130 100644 (file)
@@ -1067,6 +1067,12 @@ Status, Statistics and More
 
   :param bool verbose: Set to true if you want to enable verbose logging
 
+.. function:: getVerbose(verbose)
+
+  .. versionadded:: 1.8.0
+
+  Get whether log messages issued at the verbose level should be logged. This is turned off by default.
+
 .. function:: setVerboseHealthChecks(verbose)
 
   Set whether health check errors should be logged. This is turned off by default.