Project JEDI - Issue Tracker - JEDI VCL
Viewing Issue Advanced Details
4591 00 JVCL Components minor always 2008-11-17 15:17 2008-11-30 13:46
rdullier  
AHUser  
normal  
resolved 3.35  
fixed  
none    
none 3.36  
0004591: TJvLogFile is affected by bug 0004540, Unicode bug for AnsiString(0000013#10)
See Mantis 0004540: Can't use sLineBreak in D2009 for JvEditor.pas GetSelText

Should patch code to use sLineBreakStr here :
function TJvLogRecord.GetOutputString: string;
begin
  Result := '[' + Time + ']' + StringReplace(Title, '>', '>>', [rfReplaceAll]) +
            '>' + Description + sLineBreak;
end;

Anyway after doing so, the generated log is still buggy.
In hex view, we can see some shift in the bytes, making unicode chars unreadable. This might be occuring because of a string/ansistring mix somewhere.
1) I've inherited the class, see attachments for sample log and new class
2) Getting late today, will be able to further help tomorrow
log file icon RadarBrowser.log [^] (526 bytes) 2008-11-17 15:17
? file icon TILogWrappers.pas [^] (2,738 bytes) 2008-11-17 15:18
Issue History
2008-11-17 15:17 rdullier New Issue
2008-11-17 15:17 rdullier File Added: RadarBrowser.log
2008-11-17 15:18 rdullier File Added: TILogWrappers.pas
2008-11-17 15:18 rdullier Issue Monitored: rdullier
2008-11-18 08:23 obones Status new => acknowledged
2008-11-30 12:07 rdullier Note Added: 0015069
2008-11-30 13:46 AHUser Note Added: 0015070
2008-11-30 13:46 AHUser Status acknowledged => resolved
2008-11-30 13:46 AHUser Fixed in Version => Daily / SVN
2008-11-30 13:46 AHUser Resolution open => fixed
2008-11-30 13:46 AHUser Assigned To => AHUser
2008-12-01 09:58 rdullier Issue End Monitor: rdullier

Notes
(0015069)
rdullier   
2008-11-30 12:07   
Sadly, i tried to remove unicode support for log file doing this :
procedure TJvLogFile.SaveToStream(Stream: TStream);
var
  I: Integer;
  St: string;
begin
  with TStringList.Create do
  try
    for I := 0 to FList.Count - 1 do
      with FList[I] do
      begin
        St := GetOutputString;
        Stream.WriteBuffer(Pointer(AnsiString(St))^, Length(AnsiString(St)));
      end;
  finally
    Free;
  end;
end;


The resulting log file is not screwed.
Please note that w/o this fix, the log file is actually NOT usable, thus breaking the component.
(0015070)
AHUser   
2008-11-30 13:46   
Fixed in SVN.