Collection of log channels.
Class LogArea( name )
name | The name of the area. |
Methods | |
add | Adds a channel to this log area. |
log | Sends a log entry to all the registred channels. |
minlog | Determines what is the minimum log severity active on this area. |
remove | Removes a channel from this log area. |
Adds a channel to this log area.
LogArea.add( channel )
channel | The channel to be added. |
Sends a log entry to all the registred channels.
LogArea.log( level, message, [code] )
level | The level of the log entry. |
message | The message to be logged. |
code | A numeric code representing an application specific message ID. |
The level parameter can be an integer number, or one of the following conventional constants representing levels:
- LOGF: failure; the application met a total failure condition and is going to halt.
Determines what is the minimum log severity active on this area.
LogArea.minlog()
Return | A number representing a log severity, or -1 |
This function returns the log level accepted by the registered channel that is logging the least severe level.
Notice that severity and numerical values of the logging levels are in inverse order. So, the highest severity, which is "fatal", has an absolute value of 0, the "error" level has a value of 1 and so on.
So, to check for the log level you wish to use to be actually streamed by some of the registered channel, you have to:
if level <= GeneralLog.minlog() // ok, someone will log my entry GeneralLog.log( level, "entry" ) end
See also: gminlog.
Removes a channel from this log area.
LogArea.remove( channel )
channel | The channel to be removed. |