From b7413c4ccdaacf2616c7cd164ff1f88caf374ab2 Mon Sep 17 00:00:00 2001 From: Frederic Marchal Date: Wed, 4 Mar 2015 20:53:34 +0100 Subject: [PATCH] Display some debug messages when -z is used to track the progress When processing a big log file, sarg would remain silent for some time even with -z enabled. With those messages, the user understand what is happening. --- authfail.c | 2 ++ denied.c | 2 ++ download.c | 2 ++ siteuser.c | 2 ++ topsites.c | 2 ++ topuser.c | 2 ++ 6 files changed, 12 insertions(+) diff --git a/authfail.c b/authfail.c index f14a0b1..e3f62a6 100644 --- a/authfail.c +++ b/authfail.c @@ -144,6 +144,8 @@ void authfail_report(void) if (debugz>=LogLevel_Process) debugaz(_("Authentication failures report not produced because it is empty\n")); return; } + if (debugz>=LogLevel_Process) + debuga(_("Creating authentication failures report...\n")); snprintf(authfail_sort,sizeof(authfail_sort),"%s/authfail.int_log",tmp); snprintf(report,sizeof(report),"%s/authfail.html",outdirname); diff --git a/denied.c b/denied.c index 587fdb3..4288315 100644 --- a/denied.c +++ b/denied.c @@ -144,6 +144,8 @@ void gen_denied_report(void) if (debugz>=LogLevel_Process) debugaz(_("Denied report not produced because it is empty\n")); return; } + if (debugz>=LogLevel_Process) + debuga(_("Creating denied accesses report...\n")); if (snprintf(denied_sort,sizeof(denied_sort),"%s/denied.int_log",tmp)>=sizeof(denied_sort)) { debuga(_("Temporary directory path too long to sort the denied accesses\n")); diff --git a/download.c b/download.c index 2b3b671..675f50a 100644 --- a/download.c +++ b/download.c @@ -192,6 +192,8 @@ void download_report(void) return; } + if (debugz>=LogLevel_Process) + debuga(_("Creating download report...\n")); ouser[0]='\0'; ouser2[0]='\0'; diff --git a/siteuser.c b/siteuser.c index a939d36..b99bcb0 100644 --- a/siteuser.c +++ b/siteuser.c @@ -53,6 +53,8 @@ void siteuser(void) return; } + if (debugz>=LogLevel_Process) + debuga(_("Creating report to list who visisted what site...\n")); nsitesusers = 0; sprintf(general,"%s/sarg-general",outdirname); sprintf(sites,"%s/sarg-sites",outdirname); diff --git a/topsites.c b/topsites.c index 3777c7a..0e4f83a 100644 --- a/topsites.c +++ b/topsites.c @@ -72,6 +72,8 @@ void topsites(void) if (debugz>=LogLevel_Process) debugaz(_("Top sites report not produced because privacy option is on\n")); return; } + if (debugz>=LogLevel_Process) + debuga(_("Creating top sites report...\n")); sprintf(general,"%s/sarg-general",outdirname); sprintf(sites,"%s/sarg-sites",outdirname); diff --git a/topuser.c b/topuser.c index 8266cf5..7618248 100644 --- a/topuser.c +++ b/topuser.c @@ -84,6 +84,8 @@ void topuser(void) struct generalitemstruct item; struct userinfostruct *uinfo; + if (debugz>=LogLevel_Process) + debuga(_("Creating top users report...\n")); ntopuser = 0; snprintf(wger,sizeof(wger),"%s/sarg-general",outdirname); if((fp_in=fopen(wger,"r"))==NULL) { -- 2.39.5