From: Peter van Dijk Date: Mon, 23 May 2022 10:10:28 +0000 (+0200) Subject: dnsdist: add getVerbose() function X-Git-Tag: auth-4.8.0-alpha0~96^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e134f491d3fd43f0ff780503044048ae9860c634;p=thirdparty%2Fpdns.git dnsdist: add getVerbose() function --- diff --git a/pdns/dnsdist-console.cc b/pdns/dnsdist-console.cc index acca971812..7b2c96222a 100644 --- a/pdns/dnsdist-console.cc +++ b/pdns/dnsdist-console.cc @@ -538,6 +538,7 @@ const std::vector 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'"}, diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index da85a9bc9c..a2f2fac7c6 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -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) { diff --git a/pdns/dnsdistdist/docs/reference/config.rst b/pdns/dnsdistdist/docs/reference/config.rst index 293b060559..6bf11924d5 100644 --- a/pdns/dnsdistdist/docs/reference/config.rst +++ b/pdns/dnsdistdist/docs/reference/config.rst @@ -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.