org.as2lib.core.BasicClass +--org.as2lib.env.log.logger.AbstractLogger +--org.as2lib.env.log.logger.Bit101Logger
Logger
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.
new 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
.
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 |
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.
level | the new log level |
public function isDebugEnabled(Void):Boolean
Checks if this logger is enabled for debug level messages.
true
if debug messages are logged
public function isInfoEnabled(Void):Boolean
Checks if this logger is enabled for info level messages.
true
if info messages are logged
public function isWarningEnabled(Void):Boolean
Checks if this logger is enabled for warning level messages.
true
if warning messages are logged
public function isErrorEnabled(Void):Boolean
Checks if this logger is enabled for error level messages.
true
if error messages are logged
public function isFatalEnabled(Void):Boolean
Checks if this logger is enabled for fatal level messages.
true
if fatal messages are logged
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
.
message | the message to log |
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.
message | the message object to log |
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.
message | the message object to log |
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.
message | the message object to log |
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.
message | the message object to log |