From: Andy D. <kha...@us...> - 2006-11-22 19:37:08
|
Update of /cvsroot/planeshift/planeshift/src/common/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30774/src/common/util Modified Files: consoleout.cpp consoleout.h log.cpp Log Message: - Changed the error log so it is recreated instead of appended. Index: consoleout.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/util/consoleout.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** consoleout.cpp 9 Nov 2006 01:42:18 -0000 1.12 --- consoleout.cpp 22 Nov 2006 19:37:06 -0000 1.13 *************** *** 62,65 **** --- 62,66 ---- #include "util/pserror.h" + FILE* errorLog = NULL; static FILE* output = NULL; static ConsoleOutMsgClass maxoutput_stdout = CON_SPAM; *************** *** 133,136 **** --- 134,145 ---- //fflush (output); } + if (con == CON_ERROR || + con == CON_BUG) + { + if(!errorLog) + errorLog = fopen("errorlog.txt","w"); + vfprintf(errorLog,string,args); + fflush(errorLog); + } va_end(args); Index: consoleout.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/util/consoleout.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** consoleout.h 9 Jul 2006 21:32:14 -0000 1.11 --- consoleout.h 22 Nov 2006 19:37:06 -0000 1.12 *************** *** 24,27 **** --- 24,28 ---- #include <csutil/csstring.h> + extern FILE * errorLog; /** * Different message classes. Index: log.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/util/log.cpp,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** log.cpp 22 Nov 2006 19:08:03 -0000 1.62 --- log.cpp 22 Nov 2006 19:37:06 -0000 1.63 *************** *** 153,166 **** severity == CS_REPORTER_SEVERITY_BUG) { ! FILE *f = fopen("errorlog.txt","w"); ! if (f) ! { ! fprintf(f,msgid); ! fprintf(f," "); ! va_start(arg, msg); ! vfprintf(f,msg,arg); ! va_end(arg); ! fclose(f); ! } } --- 153,164 ---- severity == CS_REPORTER_SEVERITY_BUG) { ! if(!errorLog) ! errorLog = fopen("errorlog.txt","w"); ! fprintf(errorLog,msgid); ! fprintf(errorLog," "); ! va_start(arg, msg); ! vfprintf(errorLog,msg,arg); ! va_end(arg); ! fflush(errorLog); } |