From ef525d1f5818581d2a56df10d411237b1c14210a Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Fri, 7 Dec 2007 10:30:45 +1100 Subject: [PATCH] More and bigger files plus switch header and tail in files r2263 | dcl | 2007-12-07 10:30:45 +1100 (Fri, 07 Dec 2007) | 2 lines --- servlog.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/servlog.c b/servlog.c index cb746e69..9901eb0d 100644 --- a/servlog.c +++ b/servlog.c @@ -237,8 +237,8 @@ static const char* timestamp(void) { /*---------------------------------------------------------------------------*/ -#define MAXLOG 10000 -#define MAXFILES 20 +#define MAXLOG 100000 +#define MAXFILES 100 static FILE *fLogFile = NULL; static int iFile = 0; @@ -314,6 +314,7 @@ static const char* timestamp(void) { /* switch file if too many lines */ if(iLineCount >= MAXLOG) { + fprintf(fLogFile,"%s: <<>>\n", timestamp()); fclose(fLogFile); fLogFile = NULL; iFile++; @@ -328,6 +329,8 @@ static const char* timestamp(void) { if(1 == iLogUsable) { + if (iLineCount == 0) + fprintf(fLogFile,"%s: <<>>\n", timestamp()); fprintf(fLogFile,"%s: ", timestamp()); fprintf(fLogFile,"%s", pText); if (pText[text_len - 1] != '\n')