procedure e_InitLog (fFileName: String; fWriteMode: TWriteMode);
procedure e_DeinitLog ();
+procedure e_SetSafeSlowLog (slowAndSafe: Boolean);
+
procedure e_WriteLog (TextLine: String; RecordCategory: TRecordCategory; WriteTime: Boolean=True);
function DecodeIPV4 (ip: LongWord): string;
xlogPrefix: AnsiString;
xlogLastWasEOL: Boolean = false;
xlogWantSpace: Boolean = false;
+ xlogSlowAndSafe: Boolean = false;
+
+
+procedure e_SetSafeSlowLog (slowAndSafe: Boolean);
+begin
+ xlogSlowAndSafe := slowAndSafe;
+ if xlogSlowAndSafe and xlogFileOpened then
+ begin
+ CloseFile(xlogFile);
+ xlogFileOpened := false;
+ end;
+end;
+
procedure logwriter (constref buf; len: SizeUInt);
var
formatstrf(fmt, args, logwriter);
if not xlogLastWasEOL then writeln(xlogFile, '') else writeln(xlogFile, xlogPrefix);
+ if xlogSlowAndSafe and xlogFileOpened then
+ begin
+ CloseFile(xlogFile);
+ xlogFileOpened := false;
+ end;
+
//if fopened then CloseFile(xlogFile);
end;
for f := 1 to ParamCount do
begin
if ParamStr(f) = '--gdb' then noct := true
- else if ParamStr(f) = '--log' then conbufDumpToStdOut := true;
+ else if ParamStr(f) = '--log' then conbufDumpToStdOut := true
+ else if ParamStr(f) = '--safe-log' then e_SetSafeSlowLog(true);
end;
if noct then
begin