Class org.as2lib.env.log.logger.ZtorLog4fLogger

org.as2lib.core.BasicClass
   +--org.as2lib.env.log.logger.ZtorLog4fLogger

Implemented Interfaces

Logger

Description

ZtorLog4fLogger delegates all messages to the Log4f.log method of the ZTOR Log4f project.

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

Every global configuration must be done via the static methods on the Log4f class itself.

Field Index

ALL, DEBUG, ERROR, FATAL, INFO, LOG4F, NONE, WARN

Method Index

new ZtorLog4fLogger()

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

Inherited from BasicClass

toString()

Constructor Detail

ZtorLog4fLogger

public function ZtorLog4fLogger(level:Number)

Constructs a new ZtorLog4fLogger instance.

The level is by default set to ALL. All messages regardless of their type are logged then.

Parameters

level(optional) the level of this logger

Field Detail

ALL

static public ALL:Number
All level.

DEBUG

static public DEBUG:Number
ZTOR Log4f debug level.

INFO

static public INFO:Number
ZTOR Log4f info level.

WARN

static public WARN:Number
ZTOR Log4f warn level.

ERROR

static public ERROR:Number
ZTOR Log4f error level.

FATAL

static public FATAL:Number
ZTOR Log4f fatal level.

LOG4F

static public LOG4F:Number
ZTOR Log4f log4f level.

NONE

static public NONE:Number
None level.

Method Detail

setLevel

public function setLevel(level:Number):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):Number

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

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.

The message is logged using the Log4f.log method, passing the debug level number and the message as header.

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 at info level.

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

The message is logged using the Log4f.log method, passing the info level number and the message as header.

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 at warning level.

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

The message is logged using the Log4f.log method, passing the warn level number and the message as header.

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 at error level.

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

The message is logged using the Log4f.log method, passing the error level number and the message as header.

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 at fatal level.

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

The message is logged using the Log4f.log method, passing the fatal level number and the message as header.

Parameters

messagethe message object to log

Specified By

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