X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=htmlandlogs.c;h=c0d564894684a645e37372c6b44ab3c93e850797;hb=0995c4adca9bd65afd16064d582ae8c404c2e8d5;hp=f624a48442c56c3d508c1b01f149de98f8b9d061;hpb=9a56ab25128074e581fa5f69bac8afa2fb939c82;p=svn%2FPrometheus-QoS%2F.git diff --git a/htmlandlogs.c b/htmlandlogs.c index f624a48..c0d5648 100644 --- a/htmlandlogs.c +++ b/htmlandlogs.c @@ -30,14 +30,18 @@ void append_log(struct IP *self) /*using global variables*/ FILE *f; date(d); /* this is typical cll1.h macro - prints current date */ - string(str,STRLEN); - sprintf(str,"%s/%s.log", log_dir, self->name); - f=fopen(str,"a"); + string(str, STRLEN); + sprintf(str, "%s/%s.log", log_dir, self->name); + + /*-----------------------------------------------------------------*/ + printf("Writing traffic log %s ...\n", str); + /*-----------------------------------------------------------------*/ + f = fopen(str, "a"); if(f > 0) { - fprintf(f,"%ld\t%s\t%Lu\t%Lu\t%Lu\t%Lu\t%d\t%d\t%d\t%d\t%s", - time(NULL), self->name, self->traffic, self->direct, self->proxy, - self->upload, self->min, self->max, self->desired, self->lmsid, d); /* d = date*/ + fprintf(f, "%ld\t%s\t%Lu\t%Lu\t%Lu\t%Lu\t%d\t%d\t%d\t%d\t%s", + time(NULL), self->name, self->traffic, self->direct, self->proxy, + self->upload, self->min, self->max, self->desired, self->lmsid, d); /* d = date*/ fclose(f); } else @@ -50,7 +54,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview) { int i; char *str; - FILE *f=fopen(html,"w"); + FILE *f=fopen(html, "w"); string(str,STRLEN); if(f > 0) @@ -58,10 +62,6 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview) int count=1; i=0; - /*-----------------------------------------------------------------*/ - printf("Writing statistics summary into HTML page %s ...\n", html); - /*-----------------------------------------------------------------*/ - if(use_jquery_popups) { fprintf(f,"\n", jquery_url); @@ -195,11 +195,16 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview) { fprintf(f,"
\n",f); if(popup_button) { @@ -225,8 +230,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview) } fprintf(f,"