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

TLazLogger

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

Defines the base class for loggers used in the Lazarus IDE.

Declaration

Source position: lazloggerbase.pas line 110

type TLazLogger = class(TRefCountedObject)

protected

  procedure DoInit; virtual;

  

Performs actions needed to initialize the logger class instance.

  procedure DoFinish; virtual;

  

Performs actions needed to finalize the logger class instance.

  procedure IncreaseIndent();

  

Increases the nesting level for the logger.

  procedure DecreaseIndent();

  

Decreases the nesting level for the logger.

  procedure IndentChanged; virtual;

  

Performs actions needed when the nesting level for the logger has been changed.

  function GetBlockHandler(); virtual;

  

Gets the value for the indexed BlockHandler property.

  procedure DoDbgOut(); virtual;

  

Implements the DbgOut method for the logger type.

  procedure DoDebugLn(); virtual;

  

Implements the DebugLn method for the logger type.

  procedure DoDebuglnStack(); virtual;

  

Implements the DebugLnStack method for the logger type.

  function ArgsToString();

  

Converts the specified array of values to a string which can be displayed using the output methods for the logger type.

  property IsInitialized: Boolean; [r]

  

Indicates whether the Init method has already been called for the logger class instance.

public

  constructor Create;

  

Constructor for the class instance.

  destructor Destroy; override;

  

Destructor for the class instance.

  procedure Assign(); virtual;

  

Copies values from the logger instance in Src into the current class instance.

  procedure Init;

  

Initializes the logger class instance.

  procedure Finish;

  

Finalizes the logger class instance.

  function CurrentIndentLevel; virtual;

  

Gets the current indentation level for the logger.

  property NestLvlIndent: Integer; [rw]

  

Indicates the current nesting level for call to the logger class instance.

  property MaxNestPrefixLen: Integer; [rw]

  

Indicates the maximum length for the nesting prefix used when values are output in the logger.

  function RegisterLogGroup();

  

Creates a log group and optionally sets its enabled status.

  function FindOrRegisterLogGroup();

  

Retrieves or creates a log group for the logger.

  property LogGroupList: TLazLoggerLogGroupList; [r]

  

Container with the group instances for the logger.

  property UseGlobalLogGroupList: Boolean; [rw]

  

Indicates if the global DebugLoggerGroupList is used as the value for the LogGroupList property.

  procedure AddBlockHandler(); virtual;

  

Adds the specified handler for blobk Enter and Exit conditions.

  procedure RemoveBlockHandler(); virtual;

  

Removes the specified block handler for the logger type.

  function BlockHandlerCount; virtual;

  

Gets the number of block handlers added to the logger type.

  property BlockHandler []: TLazLoggerBlockHandler; [r]

  

Provides indexed access to the Block handlers for the logger type.

  procedure DebuglnStack();

  

Calls DoDebuglnStack to write the message in s when the logger has been enabled.

  procedure DbgOut();

  

Generates a log message with formatted value(s) for the specified type(s).

  procedure DebugLn();

  

Writes a message to the logger class instance at the current indentation level.

  procedure DebugLnEnter();

  

Writes an optional log message and increases the indentation level for the logger.

  procedure DebugLnExit();

  

Decreases the indentation level for the logger and writes an optional log message.

  procedure DumpExceptionBackTrace();

  

Writes addresses and exception frames representing the backtrace for an exception.

end;

Inheritance

TLazLogger

  

Defines the base class for loggers used in the Lazarus IDE.

|

TRefCountedObject

  

Implements a thread-safe reference-counted class which performs free notifications.

|

TFreeNotifyingObject

  

Base class used to implement objects which perform free notifications.

|

TObject

Description

TLazLogger is a TRefCountedObject descendant which implements the base class for the logger mechanism used in the Lazarus IDE and the LCL. TLazLogger defines the interface used for the various logger classes which write their content to a specific destination. Many of the method which perform the output are empty implementations, and must be re-implemented in descendent classes which write to a file or to the debugger.


Version 4.0 Generated 2025-05-03 Home