Class org.as2lib.env.log.logger.Bit101Logger

org.as2lib.core.BasicClass
   +--org.as2lib.env.log.logger.AbstractLogger
      +--org.as2lib.env.log.logger.Bit101Logger

Implemented Interfaces

Logger

Description

Bit101Logger delegates all log messages to the Debug.trace method from Keith Peter's Debug Panel.

Using this class instead of the Debug class in your application directly enables you to switch between almost every available Logging API without having to change the logging calls but just the underlying configuration on startup.

Field Index

Inherited from AbstractLogger

ALL, DEBUG, ERROR, FATAL, INFO, NONE, WARNING

Method Index

new Bit101Logger()

debug(), error(), fatal(), getLevel(), info(), isDebugEnabled(), isErrorEnabled(), isFatalEnabled(), isInfoEnabled(), isWarningEnabled(), log(), setLevel(), warning()

Inherited from BasicClass

toString()

Constructor Detail

Bit101Logger

public function Bit101Logger(traceObject:Boolean, recursionDepth:Number, indentation:Number)

Constructs a new Bit101Logger instance.

The default log level is ALL. This means all messages regardless of their level are logged.

traceObject is by default false. Refer to the Debug class for information on the default recursionDepth and indentation.

Parameters

traceObject(optional) determines whether to trace objects recursively or to use the result of their toString method
recursionDepth(optional) determines the count of recursions for recursively traced objects
indentation(optional) determines the indentation number for recursively traced objects

Method Detail

setLevel

public function setLevel(level:LogLevel):Void

Sets the log level.

The log level determines which messages are logged and which are not.

A level of value null or undefined is interpreted as level ALL, which is also the default level.

Parameters

levelthe new log level

getLevel

public function getLevel(Void):LogLevel

Returns the set level.

Return

the set level

isDebugEnabled

public function isDebugEnabled(Void):Boolean

Checks if this logger is enabled for debug level messages.

Return

true if debug messages are logged

Specified By

isDebugEnabled() in org.as2lib.env.log.Logger

isInfoEnabled

public function isInfoEnabled(Void):Boolean

Checks if this logger is enabled for info level messages.

Return

true if info messages are logged

Specified By

isInfoEnabled() in org.as2lib.env.log.Logger

isWarningEnabled

public function isWarningEnabled(Void):Boolean

Checks if this logger is enabled for warning level messages.

Return

true if warning messages are logged

Specified By

isWarningEnabled() in org.as2lib.env.log.Logger

isErrorEnabled

public function isErrorEnabled(Void):Boolean

Checks if this logger is enabled for error level messages.

Return

true if error messages are logged

Specified By

isErrorEnabled() in org.as2lib.env.log.Logger

isFatalEnabled

public function isFatalEnabled(Void):Boolean

Checks if this logger is enabled for fatal level messages.

Return

true if fatal messages are logged

Specified By

isFatalEnabled() in org.as2lib.env.log.Logger

log

public function log(message):Void

Logs the message using the Debug.trace method if traceObject is turned off or if the message is of type "string", "number", "boolean", "undefined" or "null" and using the Debug.traceObject method if neither of the above cases holds true.

Parameters

messagethe message to log

debug

public function debug(message):Void

Logs the passed-in message at debug level.

The message is only logged when the level is set to DEBUG or a level above.

Parameters

messagethe message object to log

Specified By

debug() in org.as2lib.env.log.Logger

info

public function info(message):Void

Logs the passed-in message object at info level.

The message is only logged when the level is set to INFO or a level above.

Parameters

messagethe message object to log

Specified By

info() in org.as2lib.env.log.Logger

warning

public function warning(message):Void

Logs the passed-in message object at warning level.

The message is only logged when the level is set to WARNING or a level above.

Parameters

messagethe message object to log

Specified By

warning() in org.as2lib.env.log.Logger

error

public function error(message):Void

Logs the passed-in message object at error level.

The message is only logged when the level is set to ERROR or a level above.

Parameters

messagethe message object to log

Specified By

error() in org.as2lib.env.log.Logger

fatal

public function fatal(message):Void

Logs the passed-in message object at fatal level.

The message is only logged when the level is set to FATAL or a level above.

Parameters

messagethe message object to log

Specified By

fatal() in org.as2lib.env.log.Logger