TLogMessageEvent procedure type
Defines an event handler signalled to handle log messages written using the TApplication.Log method.
Declaration
TLogMessageEvent = procedure(Sender: TObject; EventType: TEventType;
const Msg: string) of objectArguments
Sender | TObject instance which generated the event notification. |
EventType | Identifies the event type for the notification. |
Msg | Contains text with the log message for the notification. |
Description
TLogMessageEvent is an object procedure type which defines an event
handler signalled when a log message is written in
TApplication.
TLogMessageEvent allows an application to perform actions needed to format and
store a log message using the logging mechanism implemented for the
application.
Sender is the
TObject instance which generated the event
notification. It can be used to access to properties and methods in the class
when cast to the type needed. For example:
- TApplication(Sender).ApplicationType
- TApplication(Sender).ExeName
- TApplication(Sender).Location
- TApplication(Sender).Title
EventType identifies the event type for the log event. It contains
one of the values from the
TEventType enumeration.
Msg contains the message text which can be formatted and stored for
the log event.
TLogMessageEvent is the type used to implement the OnLog event
handler property in TApplication. An application must implement and assign a
handler routine using the signature in TLogMessageEvent to respond to event
notifications. The handler routine is responsible for all actions needed to
write a message to the log storage mechanism.
Added in LCL version 5.0.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
