]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Replace command line option -m by the fourth debug level
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Wed, 4 Mar 2015 17:52:26 +0000 (18:52 +0100)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Wed, 4 Mar 2015 17:52:26 +0000 (18:52 +0100)
Command line option -m is replaced by -zzzz.

getconf.c
include/conf.h
include/defs.h
log.c
readlog.c

index ea253f9336a336d79da8bfa42c1f369832c76078..ddd8830683db0ca89201d8db25567b608f102a1b 100644 (file)
--- a/getconf.c
+++ b/getconf.c
@@ -970,7 +970,7 @@ void getconf(void)
        while (fgets(buf, sizeof(buf), fp_in) != NULL) {
                fixendofline(buf);
 
-               if(debugm)
+               if (debugz>=LogLevel_Data)
                        printf("SYSCONFDIR %s\n",buf);
 
                parmtest(buf);
index f888d13e5d60abdc0ef1f1ba3696b02c7a4089d6..514b5b58cd86a32fbff2c1395f3a2a099521af43 100755 (executable)
@@ -481,7 +481,6 @@ bool iprel;
 int  langcode;
 int  debug;
 int  debugz;
-int  debugm;
 int  AuthfailReportLimit;
 int  DeniedReportLimit;
 int  DownloadReportLimit;
index d6253cddeaf6795c6c028242ad2cc81bb951c9f7..39c15971f7484befca58584daa765d1e42b2d125 100755 (executable)
@@ -14,7 +14,9 @@ enum DebugLogLevel
        //! Debug level messages.
        LogLevel_Debug,
        //! Display the source file name and line number along with the message.
-       LogLevel_Source
+       LogLevel_Source,
+       //! Display data about what is processed
+       LogLevel_Data
 };
 
 struct ReadLogStruct;//forward declaration
diff --git a/log.c b/log.c
index c34fe5cabba6a3144397a7f62ec035433134e047..234753f277b83a75375d271845a61a5d8b6f085a 100644 (file)
--- a/log.c
+++ b/log.c
@@ -256,7 +256,6 @@ int main(int argc,char *argv[])
        UserReportLimit=0;
        debug=0;
        debugz=0;
-       debugm=0;
        iprel=false;
        userip=false;
        realt=false;
@@ -283,7 +282,7 @@ int main(int argc,char *argv[])
 
        strcpy(Title,_("Squid User Access Report"));
 
-       while((ch = getopt_long(argc, argv, "a:b:c:d:e:f:g:hikl:L:mno:P:prs:t:u:Vw:xyz",long_options,&option_index)) != -1){
+       while((ch = getopt_long(argc, argv, "a:b:c:d:e:f:g:hikl:L:no:P:prs:t:u:Vw:xyz",long_options,&option_index)) != -1){
                switch(ch)
                {
                        case 0:
@@ -347,9 +346,6 @@ int main(int argc,char *argv[])
                                NRedirectorLogs++;
                                RedirectorLogFromCmdLine++;
                                break;
-                       case 'm':
-                               debugm++;
-                               break;
                        case 'n':
                                dns=true;
                                break;
@@ -620,42 +616,6 @@ int main(int argc,char *argv[])
                debuga("\n");
        }
 
-       if(debugm) {
-               const char *file;
-               printf(_("Parameters:\n"));
-               printf(_("          Hostname or IP address (-a) = %s\n"),addr);
-               printf(_("                   Useragent log (-b) = %s\n"),uagent);
-               printf(_("                    Exclude file (-c) = %s\n"),hexclude);
-               printf(_("                 Date from-until (-d) = %s\n"),ReadFilter.DateRange);
-               printf(_("   Email address to send reports (-e) = %s\n"),email);
-               printf(_("                     Config file (-f) = %s\n"),ConfigFile);
-               if (df=='e')
-                       printf(_("                     Date format (-g) = Europe (dd/mm/yyyy)\n"));
-               else if (df=='u')
-                       printf(_("                     Date format (-g) = USA (mm/dd/yyyy)\n"));
-               else if (df=='w')
-                       printf(_("                     Date format (-g) = Sites & Users (yyyy/ww)\n"));
-               printf(_("                       IP report (-i) = %s\n"),(iprel) ? _("Yes") : _("No"));
-               printf(_("            Keep temporary files (-k) = %s\n"),(KeepTempLog) ? _("Yes") : _("No"));
-               FIter=FileListIter_Open(AccessLog);
-               while ((file=FileListIter_NextWithMask(FIter))!=NULL)
-                       printf(_("                       Input log (-l) = %s\n"),file);
-               FileListIter_Close(FIter);
-               for (iarq=0 ; iarq<NRedirectorLogs ; iarq++)
-                       printf(_("                  Redirector log (-L) = %s\n"),RedirectorLogs[iarq]);
-               printf(_("              Resolve IP Address (-n) = %s\n"),(Ip2Name) ? _("Yes") : _("No"));
-               printf(_("                      Output dir (-o) = %s\n"),outdir);
-               printf(_("Use Ip Address instead of userid (-p) = %s\n"),(UserIp) ? _("Yes") : _("No"));
-               printf(_("                   Accessed site (-s) = %s\n"),site);
-               printf(_("                            Time (-t) = %s\n"),hm_str);
-               printf(_("                            User (-u) = %s\n"),us);
-               printf(_("                   Temporary dir (-w) = %s\n"),tmp);
-               printf(_("                  Debug messages (-x) = %s\n"),(debug) ? _("Yes") : _("No"));
-               printf(_("                Process messages (-z) = %d\n"),debugz);
-               printf(_(" Previous reports to keep (--lastlog) = %d\n"),LastLog);
-               printf(_("sarg version: %s\n"),VERSION);
-       }
-
        if(debug)
                debuga(_("sarg version: %s\n"),VERSION);
 
index b306509787ef8127a37bd78faf73fc2ec7de6ec1..ecfa5499c9f3e92a8bcbf10245f1a052fcd9ac00 100644 (file)
--- a/readlog.c
+++ b/readlog.c
@@ -299,7 +299,7 @@ static void ReadOneLogFile(struct ReadLogDataStruct *Filter,const char *arq)
                }
 
                totregsl++;
-               if(debugm)
+               if (debugz>=LogLevel_Data)
                        printf("BUF=%s\n",linebuf);
 
                // process the line
@@ -383,7 +383,7 @@ static void ReadOneLogFile(struct ReadLogDataStruct *Filter,const char *arq)
                }
 
                idata=builddia(log_entry.EntryTime.tm_mday,log_entry.EntryTime.tm_mon+1,log_entry.EntryTime.tm_year+1900);
-               if(debugm)
+               if (debugz>=LogLevel_Data)
                        printf("DATE=%s IDATA=%d DFROM=%d DUNTIL=%d\n",Filter->DateRange,idata,dfrom,duntil);
 
                if (EarliestDate<0 || idata<EarliestDate) {
@@ -661,7 +661,7 @@ static void ReadOneLogFile(struct ReadLogDataStruct *Filter,const char *arq)
                        }
                }
 
-               if(debugm){
+               if (debugz>=LogLevel_Data){
                        printf("IP=\t%s\n",log_entry.Ip);
                        printf("USER=\t%s\n",log_entry.User);
                        printf("ELAP=\t%ld\n",log_entry.ElapsedTime);