diff --git a/src/engine/e_log.pas b/src/engine/e_log.pas
index e2a88e08b66305dfebdc895eab2bfc17a40c9cdf..7159c18445614beaff3ba4fc3f534df33d2cf474 100644 (file)
--- a/src/engine/e_log.pas
+++ b/src/engine/e_log.pas
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation, version 3 of the License ONLY.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
// start Write/WriteLn driver. it will write everything to cbuf.
procedure e_InitWritelnDriver ();
-procedure e_LogWritefln (const fmt: AnsiString; args: array of const; category: TMsgType=TMsgType.Notify; writeTime: Boolean=true);
+procedure e_LogWritefln (const fmt: AnsiString; args: array of const; category: TMsgType=TMsgType.Notify; writeTime: Boolean=true; writeConsole: Boolean=true);
procedure e_LogWriteln (const s: AnsiString; category: TMsgType=TMsgType.Notify; writeTime: Boolean=true);
-
procedure e_WriteStackTrace (const msg: AnsiString);
-
-var
- e_WriteToStdOut: Boolean = False;
-
-
implementation
uses
- SDL2, conbuf, utils;
+ {$IFDEF ANDROID}
+ SDL2,
+ {$ENDIF}
+ conbuf, utils;
var
FirstRecord: Boolean;
end;
+function consoleAllow (const s: String): Boolean;
+begin
+ Result := False;
+ if Pos('[Chat] ', s) = 1 then
+ Exit;
+ Result := True;
+end;
+
+
procedure e_WriteLog (TextLine: String; RecordCategory: TMsgType; WriteTime: Boolean=True);
begin
- e_LogWritefln('%s', [TextLine], RecordCategory, WriteTime);
+ e_LogWritefln('%s', [TextLine], RecordCategory, WriteTime, consoleAllow(TextLine));
end;
procedure e_LogWriteln (const s: AnsiString; category: TMsgType=TMsgType.Notify; writeTime: Boolean=true);
begin
- e_LogWritefln('%s', [s], category, writeTime);
+ e_LogWritefln('%s', [s], category, writeTime, consoleAllow(s));
end;
{$IFDEF ANDROID}
cstr := GetMem(len + 1);
for slen := 0 to len - 1 do
- cstr[slen] := Char(b[slen]);
- cstr[slen + 1] := #0;
+ cstr[slen] := Chr(b[slen]);
+ cstr[len] := #0;
SDL_Log(cstr, []);
Dispose(cstr);
{$ENDIF}
end;
-procedure e_LogWritefln (const fmt: AnsiString; args: array of const; category: TMsgType=TMsgType.Notify; writeTime: Boolean=true);
+procedure e_LogWritefln (const fmt: AnsiString; args: array of const; category: TMsgType=TMsgType.Notify; writeTime: Boolean=true; writeConsole: Boolean=true);
procedure xwrite (const s: AnsiString);
begin
end;
begin
- if driverInited and (length(fmt) > 0) then
+ if driverInited and (length(fmt) > 0) and writeConsole then
begin
case category of
TMsgType.Fatal: write('FATAL: ');