Sign in Join
FPDoc Onlineexperiment

TLazLoggerFileHandle class

In unit LazLogger

Represents a file or device handle for a logger class instance.

Declaration

pascal
TLazLoggerFileHandle = class

Descends 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

LogNamepublicThe name of the log file.
UseStdOutpublicEnables writing to STDOUT, if LogName is not set.
CloseLogFileBetweenWritespublicEnable opening and closing the log for each write.
WriteTargetpublicIndicates whether logger output is directed to a File or the STDOUT device.
ActiveLogTextpublicContains the Text instance for the output destination, or Nil when unassigned.
WriteFailedCountpublicIndicates the cumulative number of failed write operations for the output handle.
LastWriteFailedpublicIndicates if the last write attempt encountered an exception or otherwise failed.

Methods

CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.
OpenFilepublicOpens the output handle for the logger when CloseLogFileBetweenWrites is False.
CloseFilepublicCloses the output handle for the logger.
ResetWriteFailedCounterpublicResets the value in WriteFailedCount to 0 (zero).
WriteToFilepublicWrites the specified log message to the output handle for the class instance.
WriteLnToFilepublicWrites 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.