]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ext_time_quota_acl: restore debug level feature and argument (#1936)
authorFrancesco Chemolli <5175948+kinkie@users.noreply.github.com>
Wed, 13 Nov 2024 23:34:15 +0000 (23:34 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 13 Nov 2024 23:34:26 +0000 (23:34 +0000)
Commit 4878cfe567 modernized the time quota ACL helper,
but removed the '-d debuglevel' feature, reducing it to a binary
toggle.

src/acl/external/time_quota/ext_time_quota_acl.8
src/acl/external/time_quota/ext_time_quota_acl.cc

index 579e0af17d7c801f65b08ae8f98fe0966f31f0c9..92fd6611fbcc7828025872ba30aca700aec4d6c7 100644 (file)
@@ -7,7 +7,7 @@ Version 1.0
 .
 .SH SYNOPSIS
 .if !'po4a'hide' .B ext_time_quota_acl
-.if !'po4a'hide' .B "[\-b database] [\-d] [\-p pauselen] [\-h] configfile
+.if !'po4a'hide' .B "[\-b database] [\-d level] [\-p pauselen] [\-h] configfile
 .
 .SH DESCRIPTION
 .B ext_time_quota_acl
@@ -36,7 +36,7 @@ Default is 300 seconds (5 minutes).
 .
 .if !'po4a'hide' .TP
 .if !'po4a'hide' .B "\-d"
-Enables debug logging to stderr.
+Sets verbosity level for debugging section 82 (0-9; defaults to 1; see debug_options).
 .
 .if !'po4a'hide' .TP
 .if !'po4a'hide' .B "\-h"
index 6a8796a18cb891795cbc93ba7b7b43ee1cd210b4..32765382e9671a6b4bc8baafc2572d337aa3a2e7 100644 (file)
@@ -328,13 +328,13 @@ static void usage(void)
     debugs(MY_DEBUG_SECTION, DBG_CRITICAL, "Wrong usage. Please reconfigure in squid.conf.");
 
     std::cerr <<
-              "Usage: " << program_name << " [-d] [-b dbpath] [-p pauselen] [-h] configfile\n"
-              "        -d            enable debugging output\n"
-              "        -l logfile    log messages to logfile\n"
-              "        -b dbpath     Path where persistent session database will be kept\n"
-              "                      If option is not used, then " DEFAULT_QUOTA_DB " will be used.\n"
-              "        -p pauselen   length in seconds to describe a pause between 2 requests.\n"
-              "        -h            show show command line help.\n"
+              "Usage: " << program_name << " [-d level] [-b dbpath] [-p pauselen] [-h] configfile\n" <<
+              "        -d level      set section " << MY_DEBUG_SECTION << " debugging to the specified level,\n"
+              "               overwriting Squid's debug_options (default: 1)\n"
+              "        -b dbpath     Path where persistent session database will be kept\n" <<
+              "                      If option is not used, then " << DEFAULT_QUOTA_DB << " will be used.\n" <<
+              "        -p pauselen   length in seconds to describe a pause between 2 requests.\n" <<
+              "        -h            show show command line help.\n" <<
               "configfile is a file containing time quota definitions.\n";
 }
 
@@ -346,10 +346,10 @@ int main(int argc, char **argv)
     program_name = argv[0];
     Debug::NameThisHelper("ext_time_quota_acl");
 
-    while ((opt = getopt(argc, argv, "dp:b:h")) != -1) {
+    while ((opt = getopt(argc, argv, "d:p:b:h")) != -1) {
         switch (opt) {
         case 'd':
-            Debug::Levels[MY_DEBUG_SECTION] = DBG_DATA;
+            Debug::parseOptions(ToSBuf(MY_DEBUG_SECTION, ",", optarg).c_str());
             break;
         case 'b':
             db_path = optarg;