From: Frederic Marchal Date: Wed, 4 Mar 2015 17:52:26 +0000 (+0100) Subject: Replace command line option -m by the fourth debug level X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4246ae8ddb3208ceeba0f06aad4633c0342dbf63;p=thirdparty%2Fsarg.git Replace command line option -m by the fourth debug level Command line option -m is replaced by -zzzz. --- diff --git a/getconf.c b/getconf.c index ea253f9..ddd8830 100644 --- 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); diff --git a/include/conf.h b/include/conf.h index f888d13..514b5b5 100755 --- a/include/conf.h +++ b/include/conf.h @@ -481,7 +481,6 @@ bool iprel; int langcode; int debug; int debugz; -int debugm; int AuthfailReportLimit; int DeniedReportLimit; int DownloadReportLimit; diff --git a/include/defs.h b/include/defs.h index d6253cd..39c1597 100755 --- a/include/defs.h +++ b/include/defs.h @@ -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 c34fe5c..234753f 100644 --- 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=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=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);