TIcsLogger.DoDebugLog uses non-optimal algorithm dealing with timestamps: it is
being added to Msg three times.
I suggest change the code as following:
procedure TIcsLogger.DoDebugLog(
Sender : TObject;
LogOption : TLogOption;
Msg : String); // remove const to avoid declaring a local variable
begin
{$IFNDEF NO_LOGGER_MT}
Lock;
try
{$ENDIF}
{$IFDEF VCL}
if csDestroying in Componentstate then { V1.02 }
Exit;
{$ENDIF}
if loAddStamp in FLogOptions then
Msg := AddTimeStamp + FTimeStampSeparator + Msg; // construct new Msg
if loDestEvent in FLogOptions then
if Assigned(FOnIcsLogEvent) then
FOnIcsLogEvent(Sender, LogOption, Msg);
if loDestOutDebug in FLogOptions then
OutputDebugString(TOutputDebugStringType(Msg));
if loDestFile in FLogOptions then
WriteToLogFile(Msg + #13#10); {V6.03}
{$IFNDEF NO_LOGGER_MT}
finally
Unlock;
end;
{$ENDIF}
end;
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be