LazLogger unit
Provides a logging framework for Lazarus applications.
LazLogger.pas provides logging facilities to write message to a
file or stdout device. Messages can be logged plain, or enclosed in begin/end
like blocks, adding indent to all messages between to points (blocks can be
nested). It also has the ability to filter groups of messages.
It can read the command line and environment to find the desired filename. By default it looks for a --debug-log= argument on the command line or "appname"_debuglog in the system environment.
If no log name is found StdOut is used.
The easiest method is to use the unit and put "DebugLn"/ "DbgOut" / "DebugLnEnter"/ "DebugLnExit" in your code. This works without any further setup.
LazLogger.pas is part of the
LazUtils package.
Classes and records
TLazLoggerFile | class | Implements a logger which uses a file or the STDOUT device as the destination for log messages. |
TLazLoggerFileHandle | class | Represents a file or device handle for a logger class instance. |
TLazLoggerFileHandleMainThread | class | Represents a File handle for logger operations queued in the main thread. |
TLazLoggerFileHandleThreadSave | class | Performs file operations using a critical section. |
Procedures and functions
assign(Boolean):TLazLoggerLogEnabled | operator | Implements the Assign (':=') operator using a Boolean argument for the TLazLoggerLogEnabled type. |
assign(PLazLoggerLogGroup):TLazLoggerLogEnabled | operator | Implements the Assign (':=') operator using a Pointer to a logger group for the TLazLoggerLogEnabled type. |
dbghex | function | Generates a message with the hexadecimal representation for the specified numeric value. |
dbgMemRange | function | Generates a message with the hexadecimal-encoded content for the specified block of memory and size. |
dbgMemStream | function | Generates a message with the hexadecimal-encoded values from the specified memory stream. |
dbgObjMem | function | Generates a message with the hexadecimal-encoded memory content for the specified object instance. |
DbgOut | procedure | Writes a message to the log. |
DbgS | function | Generates a debugger message formatted with the value(s) for the specified type(s). |
DbgSJoin | function | Generates a debugger message with the combined values of the specified arguments. |
DbgSName | function | Generates a message with the optional name and class type for the specified object. |
DbgSTime | function | Generates a message with the tick count for the computer system. |
DbgStr | function | Generates a debugger message with the content from the specified value. |
DbgWideStr | function | Generates a debugger message with the specified WideString content. |
DebugLn | procedure | Writes a message to the log. |
DebugLnEnter | procedure | Writes a message to the log. |
DebugLnExit | procedure | Writes a message to the log. |
DebuglnStack | procedure | Writes a message to the log. |
DumpExceptionBackTrace | procedure | Write the stack trace back when an exception is detected. |
GetDebugLogger | function | Gets the value for the DebugLogger property. |
logicaland(TLazLoggerLogEnabled,TLazLoggerLogEnabled):TLazLoggerLogEnabled | operator | Implements the logical And operator for TLazLoggerLogEnabled types. |
logicalor(TLazLoggerLogEnabled,TLazLoggerLogEnabled):TLazLoggerLogEnabled | operator | Implements the logical Or operator for TLazLoggerLogEnabled types. |
SetDebugLogger | procedure | Sets the value for the DebugLogger property. |
Types
DebugLogger | property | Contains the class instance for the file-based logger. |
PLazLoggerLogGroup | type | Alias for the PLazLoggerLogGroup type in the LazLoggerBase unit. |
TLazLoggerWriteExEventInfo | type | Alias for the TLazLoggerWriteExEventInfo type in lazloggerbase.pas. |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
