Class org.as2lib.env.log.handler.AscbHandler

org.as2lib.core.BasicClass
   +--org.as2lib.env.log.handler.AscbHandler

Implemented Interfaces

LogHandler

Description

AscbHandler delegates the log message to the LogManager.log method of the ASCB Logging API.

Method Index

new AscbHandler()

getInstance(), write()

Inherited from BasicClass

toString()

Constructor Detail

AscbHandler

public 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.

Method Detail

getInstance

static public function getInstance(Void):AscbHandler

Returns an instance of this class.

This method always returns the same instance.

Return

a ascb handler

write

public 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

messagethe message to log

Specified By

write() in org.as2lib.env.log.LogHandler