Anton, > TIcsLogger.DoDebugLog uses non-optimal algorithm dealing with > timestamps: it is being added to Msg three times.
I do not think that people use multiple log destinations at the same time. Currently the string is allocated and concatenated only when actually required. > I suggest change > the code as following: This is non-optimal as well. You always concatenate and allocate the string even though it's not used. That sure leads to smaller source code but only performs faster _if you actually write to multiple log destinations. -- Arno Garrels > > 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