]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - dansguardian_report.c
Display the source of the message displayed on stderr
[thirdparty/sarg.git] / dansguardian_report.c
index f73460ef2b9e055b6b740db1ef40379e4270fa9b..08c2a57abf3afaf9224ceb95c2b3b7ef75de3ab4 100644 (file)
@@ -61,20 +61,20 @@ void dansguardian_report(void)
        snprintf(dansguardian_in,sizeof(dansguardian_in),"%s/dansguardian.int_log",tmp);
        if(!dansguardian_count) {
                if (!KeepTempLog && unlink(dansguardian_in))
-                       debuga(_("Cannot delete \"%s\": %s\n"),dansguardian_in,strerror(errno));
-               if (debugz>=LogLevel_Process) debugaz(_("Dansguardian report not generated because it is empty\n"));
+                       debuga(__FILE__,__LINE__,_("Cannot delete \"%s\": %s\n"),dansguardian_in,strerror(errno));
+               if (debugz>=LogLevel_Process) debugaz(__FILE__,__LINE__,_("Dansguardian report not generated because it is empty\n"));
                return;
        }
 
        sprintf(report,"%s/dansguardian.html",outdirname);
 
        if((fp_in=MY_FOPEN(dansguardian_in,"r"))==NULL) {
-               debuga(_("Cannot open file \"%s\": %s\n"),dansguardian_in,strerror(errno));
+               debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),dansguardian_in,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if((fp_ou=MY_FOPEN(report,"w"))==NULL) {
-               debuga(_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
+               debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -92,15 +92,15 @@ void dansguardian_report(void)
                getword_start(&gwarea,buf);
                if (getword(user,sizeof(user),&gwarea,'\t')<0 || getword(date2,sizeof(date2),&gwarea,'\t')<0 ||
                    getword(hour,sizeof(hour),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) {
-                       debuga(_("Invalid record in file \"%s\"\n"),dansguardian_in);
+                       debuga(__FILE__,__LINE__,_("Invalid record in file \"%s\"\n"),dansguardian_in);
                        exit(EXIT_FAILURE);
                }
                if (getword_ptr(buf,&url,&gwarea,'\t')<0) {
-                       debuga(_("Invalid url in file \"%s\"\n"),dansguardian_in);
+                       debuga(__FILE__,__LINE__,_("Invalid url in file \"%s\"\n"),dansguardian_in);
                        exit(EXIT_FAILURE);
                }
                if (getword(rule,sizeof(rule),&gwarea,'\n')<0) {
-                       debuga(_("Invalid rule in file \"%s\"\n"),dansguardian_in);
+                       debuga(__FILE__,__LINE__,_("Invalid rule in file \"%s\"\n"),dansguardian_in);
                        exit(EXIT_FAILURE);
                }
 
@@ -160,7 +160,7 @@ void dansguardian_report(void)
                fprintf(fp_ou,"</td><td class=\"data2\">%s</td></tr>\n",rule);
        }
        if (fclose(fp_in)==EOF) {
-               debuga(_("Read error in \"%s\": %s\n"),dansguardian_in,strerror(errno));
+               debuga(__FILE__,__LINE__,_("Read error in \"%s\": %s\n"),dansguardian_in,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -170,12 +170,12 @@ void dansguardian_report(void)
        fputs("</table></div>\n",fp_ou);
        write_html_trailer(fp_ou);
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Write error in \"%s\": %s\n"),report,strerror(errno));
+               debuga(__FILE__,__LINE__,_("Write error in \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if (!KeepTempLog && unlink(dansguardian_in)) {
-               debuga(_("Cannot delete \"%s\": %s\n"),dansguardian_in,strerror(errno));
+               debuga(__FILE__,__LINE__,_("Cannot delete \"%s\": %s\n"),dansguardian_in,strerror(errno));
                exit(EXIT_FAILURE);
        }