Access keys

AscbHandler

Kind of class: class
Inherits from: BasicClass
Implements:
Author: Simon Wacker
Classpath: org.as2lib.env.log.handler.AscbHandler
File last modified: Sunday, 26 June 2005, 13:58:26
AscbHandler delegates the log message to the LogManager.log
method of the ASCB Logging API.

Summary

Constructor
Class methods
Instance methods
Instance methods inherited from BasicClass

Constructor

AscbHandler

function AscbHandler (
Void)
Constructs a new AscbHandler instance.

You can use one and the same instance for multiple loggers. So think about
using the handler returned by the static getInstance method. Using this
instance prevents the instantiation of unnecessary ascb handlers and saves
storage.

Class methods

getInstance

static function getInstance (
Void) : AscbHandler
Returns an instance of this class.

This method always returns the same instance.

Returns:
a ascb handler

Instance methods

write

function write (
message:LogMessage) : Void
Converts the passed-in message to a format that is expected formatters
of the ASCB Logging API and passes the converted message to the
LogManager.log method of the ASCB Logging API.

The converted object has the following variables:


level


ASCB Logging API level number of the message. The former As2lib
LogLevel returned by LogMessage.getLevel was converted to
this level number by the convertLevel method.

message


The actual message to log. That is the message returned by the
LogMessage.getMessage method.

name


The name of the logger returned by the LogMessage.getLoggerName
method.

time


The time when the logging took place. This is a Date instance
configured with the timestamp returned by the method
LogMessage.getTimeStamp.

logMessage


The passed-in message instance. This variable may be used by your
own formatter if you want to take advantage of the stringifier of the
LogMessage.

Parameters:
message:
the message to log