comp • gb.logging • logger

Logger (gb.logging)

This class provides the basic mechanism for sending messages to a log.

As you can create as many Logger objects as you like, this component provides an excellent means to manage multiple active logs.

For a more advanced usage, you can use a ComplexLogger to define multiple Output, or even define your own, like sending the data over a TCP connection!

This class can be used like an object by creating a hidden instance on demand.
This class is
Creates a new Logger object targeting the log file specified by sOutput. The minimum acceptable message level is specified by the iMinLevel parameter.
creatable
.
This class can be used as a
Sub Logger ( sMessage As String [ , iLevel As Integer ] )
function
.

Constants

Constant that defines a log message as Critical.
Critical  
Constant that defines a log message as being of Debug information level.
Debug  
DefaultFormat  
Constant that defines a log message as being of Error level.
Error  
Constant that defines a log message as being of Info (informational) level.
Info  
Constant that defines a log message as being of standard error level.
Stderr  
Constant that defines a log message as being of standard output level.
Stdout  
Constant that defines a log message as being of Warning level.
Warning  

Properties

Methods
Returns or sets the status of the Logger. If set to False, every call to Log will be ignored.
Enabled  
Sets or returns the format for log messages produced by the Logger object.
Format  
Sets or returns the minimum logging level for the Logger object. The levels are defined by the component's constants, viz
Level  
Returns the path to where the log is being saved.
Output  
Initializes the Logger. You need to call this method before logging anything, it will make sure that the Output file is available and ready to be written.
Begin  
Writes sMessage to the log file, or to the defined output if the call to isEnabledFor returns True for the level iLevel .
Log  
Returns whether the Logger object is enabled for (i.e. will not ignore messages for) the message level specified by iLevel.
isEnabledFor