summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f60063)
raw | patch | inline | side by side (parent: 7f60063)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Thu, 24 Aug 2017 15:58:38 +0000 (18:58 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Thu, 24 Aug 2017 16:08:02 +0000 (19:08 +0300) |
src/engine/e_log.pas | patch | blob | history | |
src/game/Doom2DF.dpr | patch | blob | history |
diff --git a/src/engine/e_log.pas b/src/engine/e_log.pas
index 523c27f068de6ab6392058a12714edf8bda543ed..aba6e0d99d3f794b3de7f85dbf69d99de4c32a57 100644 (file)
--- a/src/engine/e_log.pas
+++ b/src/engine/e_log.pas
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;
diff --git a/src/game/Doom2DF.dpr b/src/game/Doom2DF.dpr
index de39e510d8d65bbe3cd76f1506ed7014d2f4352a..1276f72430fd0e32369cb63b4a5c24b495fd43c0 100644 (file)
--- a/src/game/Doom2DF.dpr
+++ b/src/game/Doom2DF.dpr
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