diff --git a/src/engine/e_log.pas b/src/engine/e_log.pas
index 3a8d0adc2900ef25e1f3fb3ea896c54320504e3e..ed4cfe525f4479957cca8754c690a99be9f64b4c 100644 (file)
--- a/src/engine/e_log.pas
+++ b/src/engine/e_log.pas
procedure e_InitWritelnDriver ();
procedure e_LogWritefln (const fmt: AnsiString; args: array of const; category: TRecordCategory=MSG_NOTIFY; writeTime: Boolean=true);
+procedure e_LogWriteln (const s: AnsiString; category: TRecordCategory=MSG_NOTIFY; writeTime: Boolean=true);
+
+
+procedure e_WriteStackTrace (const msg: AnsiString);
var
end;
+procedure e_LogWriteln (const s: AnsiString; category: TRecordCategory=MSG_NOTIFY; writeTime: Boolean=true);
+begin
+ e_LogWritefln('%s', [s], category, writeTime);
+end;
+
+
// returns formatted string if `writerCB` is `nil`, empty string otherwise
//function formatstrf (const fmt: AnsiString; args: array of const; writerCB: TFormatStrFCallback=nil): AnsiString;
//TFormatStrFCallback = procedure (constref buf; len: SizeUInt);
end;
+{$I-}
+procedure e_WriteStackTrace (const msg: AnsiString);
+var
+ tfo: TextFile;
+begin
+ e_LogWriteln(msg, MSG_FATALERROR);
+ if (Length(FileName) > 0) then
+ begin
+ if xlogFileOpened then CloseFile(xlogFile);
+ xlogFileOpened := false;
+ AssignFile(tfo, FileName);
+ Append(tfo);
+ if (IOResult <> 0) then Rewrite(tfo);
+ if (IOResult = 0) then begin writeln(tfo, '====================='); DumpExceptionBackTrace(tfo); CloseFile(tfo); end;
+ end;
+end;
+
+
procedure e_DeinitLog ();
begin
if xlogFileOpened then CloseFile(xlogFile);