summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e3e5f24)
raw | patch | inline | side by side (parent: e3e5f24)
author | Stas'M <x86corez@gmail.com> | |
Fri, 18 May 2018 22:56:06 +0000 (01:56 +0300) | ||
committer | Stas'M <x86corez@gmail.com> | |
Fri, 18 May 2018 22:56:33 +0000 (01:56 +0300) |
src/engine/e_log.pas | patch | blob | history |
diff --git a/src/engine/e_log.pas b/src/engine/e_log.pas
index 22db6527781c00ec9d8301d13e2b705a5365c7e4..186e1bd924a2ae3f0753c95380d5ed6434c18ca0 100644 (file)
--- a/src/engine/e_log.pas
+++ b/src/engine/e_log.pas
// 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);
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;
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: ');