Try to avoid binary data in log, use shorter descriptions
authorunc0rr
Sat, 18 Dec 2010 21:08:02 +0300
changeset 4555 85150dfb5959
parent 4554 8afc607457b0
child 4556 c7f4eb6cbd0c
child 4557 4004bef2aa9d
Try to avoid binary data in log, use shorter descriptions
hedgewars/uCommands.pas
hedgewars/uConsole.pas
hedgewars/uIO.pas
--- a/hedgewars/uCommands.pas	Sat Dec 18 10:46:59 2010 -0500
+++ b/hedgewars/uCommands.pas	Sat Dec 18 21:08:02 2010 +0300
@@ -56,11 +56,11 @@
 begin
 //WriteLnToConsole(CmdStr);
 if CmdStr[0]=#0 then exit;
-{$IFDEF DEBUGFILE}AddFileLog('ParseCommand "' + CmdStr + '"');{$ENDIF}
 c:= CmdStr[1];
 if c in ['/', '$'] then Delete(CmdStr, 1, 1) else c:= '/';
 s:= '';
 SplitBySpace(CmdStr, s);
+{$IFDEF DEBUGFILE}AddFileLog('[Cmd] ' + c + CmdStr + ' (' + inttostr(length(CmdStr)) + ')');{$ENDIF}
 t:= Variables;
 while t <> nil do
       begin
--- a/hedgewars/uConsole.pas	Sat Dec 18 10:46:59 2010 -0500
+++ b/hedgewars/uConsole.pas	Sat Dec 18 21:08:02 2010 +0300
@@ -31,7 +31,7 @@
 uses Types, uVariables, uUtils;
 
 const cLineWidth: LongInt = 0;
-      cLinesCount = 256;
+      cLinesCount = 8;
 
 type
       TTextLine = record
@@ -52,7 +52,7 @@
     done: boolean;
 begin
 {$IFNDEF NOCONSOLE}
-{$IFDEF DEBUGFILE}AddFileLog('Console write: ' + s);{$ENDIF}
+{$IFDEF DEBUGFILE}AddFileLog('[Con] ' + s);{$ENDIF}
 Write(s);
 done:= false;
 
--- a/hedgewars/uIO.pas	Sat Dec 18 10:46:59 2010 -0500
+++ b/hedgewars/uIO.pas	Sat Dec 18 21:08:02 2010 +0300
@@ -139,7 +139,7 @@
      else
      loTicks:= SDLNet_Read16(@s[byte(s[0]) - 1]);
      AddCmd(loTicks, s);
-     {$IFDEF DEBUGFILE}AddFileLog('IPC in: '+s[1]+' ticks '+IntToStr(lastcmd^.loTime));{$ENDIF}
+     {$IFDEF DEBUGFILE}AddFileLog('[IPC in] '+s[1]+' ticks '+IntToStr(lastcmd^.loTime));{$ENDIF}
      end
 end;
 
@@ -220,7 +220,7 @@
     SendEmptyPacketTicks:= 0;
     if s[0]>#251 then s[0]:= #251;
     SDLNet_Write16(GameTicks, @s[Succ(byte(s[0]))]);
-    {$IFDEF DEBUGFILE}AddFileLog('IPC send: '+ s[1]);{$ENDIF}
+    {$IFDEF DEBUGFILE}AddFileLog('[IPC out] '+ s[1]);{$ENDIF}
     inc(s[0], 2);
     SDLNet_TCP_Send(IPCSock, @s, Succ(byte(s[0])))
     end
@@ -247,7 +247,7 @@
 procedure SendIPCTimeInc;
 const timeinc: shortstring = '#';
 begin
-{$IFDEF DEBUGFILE}AddFileLog('IPC Send #');{$ENDIF}
+{$IFDEF DEBUGFILE}AddFileLog('[IPC out] <time increment>');{$ENDIF}
 SendIPCRaw(@timeinc, 2)
 end;