From c4eae67bc403eb26af8a1c91f9eb67dc92a8b4b6 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Tue, 5 Feb 2008 11:40:45 +0000 Subject: updated to latest version of JEDI SDL JEDI-SDL v1.0 Final RC ( 2008-01-29 05:46 ) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@811 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/lib/JEDI-SDL/SDL/Pas/logger.pas | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Game/Code/lib/JEDI-SDL/SDL/Pas/logger.pas') diff --git a/Game/Code/lib/JEDI-SDL/SDL/Pas/logger.pas b/Game/Code/lib/JEDI-SDL/SDL/Pas/logger.pas index 88bb1698..461fa261 100644 --- a/Game/Code/lib/JEDI-SDL/SDL/Pas/logger.pas +++ b/Game/Code/lib/JEDI-SDL/SDL/Pas/logger.pas @@ -1,6 +1,6 @@ unit logger; { - $Id: logger.pas,v 1.1 2004/02/05 00:08:20 savage Exp $ + $Id: logger.pas,v 1.2 2006/11/26 16:58:04 savage Exp $ } {******************************************************************************} @@ -63,6 +63,9 @@ unit logger; {******************************************************************************} { $Log: logger.pas,v $ + Revision 1.2 2006/11/26 16:58:04 savage + Modifed to create separate log files. Therefore each instance running from the same directory will have their own individual log file, prepended with a number. + Revision 1.1 2004/02/05 00:08:20 savage Module 1.0 release @@ -107,10 +110,20 @@ implementation { TLogger } constructor TLogger.Create; +var + FileName : string; + FileNo : integer; begin FApplicationName := ExtractFileName( ParamStr(0) ); FApplicationPath := ExtractFilePath( ParamStr(0) ); - AssignFile( FFileHandle, FApplicationPath + ChangeFileExt( FApplicationName, '.log' ) ); + FileName := FApplicationPath + ChangeFileExt( FApplicationName, '.log' ); + FileNo := 0; + while FileExists( FileName ) do + begin + inc( FileNo ); + FileName := FApplicationPath + IntToStr( FileNo ) + ChangeFileExt( FApplicationName, '.log' ) + end; + AssignFile( FFileHandle, FileName ); ReWrite( FFileHandle ); (*inherited Create( FApplicationPath + ChangeFileExt( FApplicationName, '.log' ), fmCreate {$IFNDEF FPC}or fmShareExclusive{$ENDIF} );*) -- cgit v1.2.3