Indy 9
|
TIdLogBase = class(TIdConnectionIntercept)
TIdLogBase is a descendant of TIdConnectionIntercept. TIdLogBase implements inherited virtual methods to write text strings to a log when TIdSocketHandle operations are performed. These operations include connect, read, write, and disconnect.
Messages written to the log may optionally transform all EOL characters, (Carriage Return + Line Feed) by default, to the token '<EOL>'. A log message can optionally generate the date and time it was written to the log.
Note: TIdLogBase does not specify the destination for log messages. TIdLogBase descendants must implement the virtual methods in the class to resolve where log messages are stored, or written.
TIdLogBase is the ancestor class for the TIdLogDebug component. TIdLogDebug demonstrates an implementation that can store messages in a file stream or write messages to the standard Debugger Output.
property Active: Boolean;
property LogTime: Boolean;
If LogTime is True, a message will have the current date and time prepended to the message contents. Date and time is formatted using the value given in the global ShortDateFormat variable.
LogTime is called from virtual methods in the class as a part of message formatting routines.
property ReplaceCRLF: Boolean;
procedure Connect(AConnection: TComponent); override;
01/01/20000 13:03:42: Connected.
Set LogTime to True to include date and time information in the log message.
Connect calls the inherited Connect method prior to generating the status message.
constructor Create(AOwner: TComponent); override;
Note: Applications should not create instances of TIdLogBase. Create a TIdLogBase descendant, like TIdLogDebug, that implements the abstract methods for writing and storing messages to the desired destination.
destructor Destroy; override;
procedure Disconnect; override;
01/01/20000 13:03:42: Disconnected.
Set LogTime to True to include date and time information in the log message. Connect relies on a virtual ethod to perform formatting and output of messages to the log.
Disconnect calls the inherited Disconnect method to reset the component that owns the connection.
procedure Receive(ABuffer: TStream); override;
When LogTime is True, the current date and time stamp is prepended to the log message.
When ReplaceCRLF is True, all instances of CR, LF, and EOL in the message are replaced with their tag counterparts, "<CR>", "<LF>", and "<EOL>".
procedure Send(ABuffer: TStream); override;
When LogTime is True, the current date and time stamp is prepended to the log message.
When ReplaceCRLF is True, all instances of CR, LF, and EOL in the message are replaced with their tag counterparts, "<CR>", "<LF>", and "<EOL>".