Class org.as2lib.env.log.handler.Bit101Handler

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

Implemented Interfaces

LogHandler

Description

Bit101Handler logs messages to the Bit-101 Debug Panel.

The Debug class is needed.

Method Index

new Bit101Handler()

getInstance(), write()

Inherited from BasicClass

toString()

Constructor Detail

Bit101Handler

public function Bit101Handler(decorateMessage:Boolean, recursionDepth:Number, indentation:Number)

Constructs a new Bit101Handler 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 bit-101 handlers and saves storage.

decorateMessage is by default true. Refer to the Debug class for information on the default recursionDepth and indentation.

Note that messages are only logged recursively if decorateMessage is set to false.

Parameters

decorateMessage(optional) determines whether to log the string returned by the LogMessage.toString method or just the message returned by LogMessage.getMessage
recursionDepth(optional) determines the count of recursions for recursively traced objects
indentation(optional) determines the indentation number for recursively traced objects

Method Detail

getInstance

static public function getInstance(decorateMessage:Boolean, recursionDepth:Number, indentation:Number):Bit101Handler

Returns an instance of this class.

This method always returns the same instance.

Note that the arguments are only recognized on first call of this method and are in this case used for construction of the Bit101Handler instance.

Parameters

decorateMessage(optional) determines whether to log the string returned by the LogMessage.toString method or just the message returned by LogMessage.getMessage
recursionDepth(optional) determines the count of recursions for recursively traced objects
indentation(optional) determines the indentation number for recursively traced objects

Return

a bit-101 handler

write

public function write(message:LogMessage):Void

Writes log messages to the Bit-101 Debug Panel.

Uses the LogMessage.toString method to obtain the string that is logged if decorateMessage is turned on. Otherwise the string returned by the original message's toString method is logged if it is of type "string", "number", "boolean", "undefined" or "null" or the original method is logged recursively if it is not of one of the above types.

Parameters

messagethe message to log

Specified By

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