[fpc-devel] TCustomApplication.Log(?)

Joost van der Sluis joost at cnoc.nl
Mon Feb 15 21:45:33 CET 2010


Hi all,

I want to add (abstract) logging functionality to TCustomApplication. I
see three options:

One:
Add a public TEventLog property to TCustomApplication. Then deratives of
TCustumApplication can return a TEventLog or a derivate of it. I can
leave the TEventLog property nil for TCustomApplication, or let it
return an instance TEventLog. That way you can adda log-message as
follows:

Application.Eventlog.Log(EtInfo);

Two:
Add an abstract (or maybe better, an empty) procedure to
TCustomApplication, procedure Log(AType: TEventType; Message: string);
virtual; (abstract);
I can leave out the AType parameter, but I think it's useful for all
cases. Classes derived from TCustomApplication can implement their own
handling.

Three:
Same as two, but also add a real implementation using TEventLog. So that
by default everything is logged to the system log, or when the user
wants to to a file.

I think option two is the best one. Then I can use the TEventLog for
daemon and web applications. But I'm really interested in the opinion of
the Lazarus and MseIDE people. Although I think that MseIDE doesn't use
the TCustomApplication?

Joost.




More information about the fpc-devel mailing list