Arno, if you care about "slowing" string concatenations (although concatenation 
will be executed *anyway*: Time+Sep+Msg), then we could do something like this:

FDateFormat, FTimeFormat, FDateTimeFormat: string;
...
procedure SetDateTimeFormat(df, tf: string);
begin
  FDateFormat := df;
  FTimeFormat := tf;
  FDateTimeFormat := FDateFormat + FLogSep + FTimeFormat;
end;

and

procedure SetLogSep(ls: char);
begin
  FLogSep := ls;
  FDateTimeFormat := FDateFormat + FLogSep + FTimeFormat;
end;

- two methods are used to implement independence between format strings and log 
sep. Or, we really could just set DateTimeFormat as single string, not taking 
care about a separator between date and time. But also you should do something 
with code for .NET, to make output configurable too.
I sent Francois my modification of unit, it of course isn't ideal, but it's 
something to start from. Also there is a check of CR/LF in the end of logged 
line, to avoid doubling of these characters when Msg already contains them (FTP 
server responses, for example).

--
Regards, 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

Reply via email to