TLazLoggerFileHandle class
Represents a file or device handle for a logger class instance.
Declaration
TLazLoggerFileHandle = classDescends from it: TLazLoggerFileHandleMainThread TLazLoggerFileHandleThreadSave
Description
Provides functionality to write messages to a log file. The file is represented by a Text member stored internally. TLazLoggerFileHandle allows filtering and changing indent level.
TLazLoggerFileHandle can parse options from command line for log filename and filter settings.
An application can subclass the logger handle to provide additional functionality.
Used in the implementation of the TLazLoggerFile class.
Properties
LogName | public | The name of the log file. |
UseStdOut | public | Enables writing to STDOUT, if LogName is not set. |
CloseLogFileBetweenWrites | public | Enable opening and closing the log for each write. |
WriteTarget | public | Indicates whether logger output is directed to a File or the STDOUT device. |
ActiveLogText | public | Contains the Text instance for the output destination, or Nil when unassigned. |
WriteFailedCount | public | Indicates the cumulative number of failed write operations for the output handle. |
LastWriteFailed | public | Indicates if the last write attempt encountered an exception or otherwise failed. |
Methods
Create | public | Constructor for the class instance. |
Destroy | public | Destructor for the class instance. |
OpenFile | public | Opens the output handle for the logger when CloseLogFileBetweenWrites is False. |
CloseFile | public | Closes the output handle for the logger. |
ResetWriteFailedCounter | public | Resets the value in WriteFailedCount to 0 (zero). |
WriteToFile | public | Writes the specified log message to the output handle for the class instance. |
WriteLnToFile | public | Writes the specified log message to the output handle for the class instance. |
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
