2.7.2Class LogArea

Collection of log channels.

Class LogArea( name )
name The name of the area.
Methods
addAdds a channel to this log area.
logSends a log entry to all the registred channels.
minlogDetermines what is the minimum log severity active on this area.
removeRemoves a channel from this log area.

Methods

add

Adds a channel to this log area.

LogArea.add( channel )
channel The channel to be added.

log

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.

minlog

Determines what is the minimum log severity active on this area.

LogArea.minlog()
ReturnA 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.

remove

Removes a channel from this log area.

LogArea.remove( channel )
channel The channel to be removed.
Made with http://www.falconpl.org