</descrip>
+<sect1>Other changes<label id="otherchanges">
+<p>
+<descrip>
+ <tag>Adjusted configuration and format of ext_time_quota_acl helper debugging</tag>
+ <p>The <em>-l</em> option that enables <em>ext_time_quota_acl</em> to log debug messages
+ to a custom logfile has been removed, and their format has been
+ changed to be in line with Squid's cache.log format.
+</descrip>
+
<sect>Copyright
<p>
Copyright (C) 1996-2023 The Squid Software Foundation and contributors
.
.SH SYNOPSIS
.if !'po4a'hide' .B ext_time_quota_acl
-.if !'po4a'hide' .B "[\-b database] [\-l logfile] [\-d] [\-p pauselen] [\-h] configfile
+.if !'po4a'hide' .B "[\-b database] [\-d] [\-p pauselen] [\-h] configfile
.
.SH DESCRIPTION
.B ext_time_quota_acl
Default is 300 seconds (5 minutes).
.
.if !'po4a'hide' .TP
-.if !'po4a'hide' .B "\-l logfile"
-.B Filename
-where all logging and debugging information will be written. If none is given,
-then stderr will be used and the logging will go to Squids main cache.log.
-.
-.if !'po4a'hide' .TP
.if !'po4a'hide' .B "\-d"
-Enables debug logging in the logfile.
+Enables debug logging to stderr.
.
.if !'po4a'hide' .TP
.if !'po4a'hide' .B "\-h"
static FILE *logfile = stderr;
static int tq_debug_enabled = false;
-static void open_log(const char *logfilename)
-{
- logfile = fopen(logfilename, "a");
- if ( logfile == NULL ) {
- perror(logfilename);
- logfile = stderr;
- }
-}
-
static void vlog(const char *level, const char *format, va_list args)
{
time_t now = time(NULL);
static void usage(void)
{
- log_error("Wrong usage. Please reconfigure in squid.conf.\n");
-
- fprintf(stderr, "Usage: %s [-d] [-l logfile] [-b dbpath] [-p pauselen] [-h] configfile\n", program_name);
- fprintf(stderr, " -d enable debugging output to logfile\n");
- fprintf(stderr, " -l logfile log messages to logfile\n");
+ fprintf(stderr, "Usage: %s [-d] [-b dbpath] [-p pauselen] [-h] configfile\n", program_name);
+ fprintf(stderr, " -d enable debugging output\n");
fprintf(stderr, " -b dbpath Path where persistent session database will be kept\n");
fprintf(stderr, " If option is not used, then " DEFAULT_QUOTA_DB " will be used.\n");
fprintf(stderr, " -p pauselen length in seconds to describe a pause between 2 requests.\n");
program_name = argv[0];
- while ((opt = getopt(argc, argv, "dp:l:b:h")) != -1) {
+ while ((opt = getopt(argc, argv, "dp:b:h")) != -1) {
switch (opt) {
case 'd':
tq_debug_enabled = true;
break;
- case 'l':
- open_log(optarg);
- break;
case 'b':
db_path = optarg;
break;
usage();
exit(EXIT_SUCCESS);
break;
+ default:
+ // getopt() emits error message to stderr
+ usage();
+ exit(EXIT_FAILURE);
+ break;
}
}