[Overview][Types][Classes][Procedures and functions][Index] Reference for unit 'LazLogger' (#lazutils)

TLazLoggerFileHandle

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

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

Declaration

Source position: lazlogger.pas line 38

type TLazLoggerFileHandle = class

public

  constructor Create;

  

Constructor for the class instance.

  destructor Destroy; override;

  

Destructor for the class instance.

  procedure OpenFile;

  

Opens the output handle for the logger when CloseLogFileBetweenWrites is False.

  procedure CloseFile;

  

Closes the output handle for the logger.

  procedure ResetWriteFailedCounter;

  

Resets the value in WriteFailedCount to 0 (zero).

  procedure WriteToFile(); virtual;

  

Writes the specified log message to the output handle for the class instance.

  procedure WriteLnToFile(); virtual;

  

Writes the specified log message to the output handle for the class instance.

  property LogName: string; [rw]

  

The name of the log file.

  property UseStdOut: Boolean; [rw]

  

Enables writing to STDOUT, if LogName is not set.

  property CloseLogFileBetweenWrites: Boolean; [rw]

  

Enable opening and closing the log for each write.

  property WriteTarget: TLazLoggerWriteTarget; [r]

  

Indicates whether logger output is directed to a File or the STDOUT device.

  property ActiveLogText: PText; [r]

  

Contains the Text instance for the output destination, or Nil when unassigned.

  property WriteFailedCount: Integer; [r]

  

Indicates the cumulative number of failed write operations for the output handle.

  property LastWriteFailed: Boolean; [r]

  

Indicates if the last write attempt encountered an exception or otherwise failed.

end;

Inheritance

TLazLoggerFileHandle

  

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

|

TObject

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.


Version 4.0 Generated 2025-05-03 Home