Class LogArea[in Logging support]

Collection of log channels.

class LogArea( name )

Summary

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.

Methods

add()

Adds a channel to this log area.

LogArea.add( channel )

channelThe channel to be added.

log()

Sends a log entry to all the registred channels.

LogArea.log( level, message, [code] )

levelThe level of the log entry.
messageThe message to be logged.
codeA 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:

minlog()

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

LogArea.minlog( )

Returns: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

remove()

Removes a channel from this log area.

LogArea.remove( channel )

channelThe channel to be removed.

Made with faldoc 2.2.1