(Gast)
n/a Beiträge
|
Re: Zeilenanzahl bei name.log Datei begrenzen
20. Jul 2009, 15:00
Delphi-Quellcode:
constructor TLogFile.Create(FileName: string; LogSize: integer;
AppLog: boolean);
begin
FFileName := FileName;
FLogSize := LogSize;
FAppLog := AppLog;
end;
procedure TLogFile.AddLine(Line: string);
var
F: TextFile;
Zeile: String;
begin
FileMode := fmOpenReadWrite;
AssignFile(F, FFileName);
try
Append(F);
except
Rewrite(F);
end;
Zeile := FormatDateTime('c.zzz - ', Now)+Line;
WriteLn(F, Zeile);
CloseFile(F);
end;
|
|
Zitat
|