Class org.as2lib.env.log.handler.LevelFilterHandler

Implemented Interfaces

LogHandler

Description

LevelFilterHandler filters log messages depending on their level.

Field Index

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

Method Index

new LevelFilterHandler()
getHandler(), getLevel(), write()

Constructor Detail

LevelFilterHandler

public function LevelFilterHandler(handler:LogHandler, level:LogLevel)

Constructs a new LevelFilterHandler instance.

All log messages with a lower level than the passed-in level get filtered out.

If level is not passed-in or is null or undefined all levels will be allowed, this means it will be set to AbstractLogLevel.ALL.

Parameters

handlerthe handler to forward not-filtered log messages to

Throws

IllegalArgumentExceptionif the passed-in handler is null or undefined

Field Detail

ALL

static public ALL:LogLevel
All log messages get logged.

DEBUG

static public DEBUG:LogLevel
All log messages that are at a lower log level than debug get logged.

INFO

static public INFO:LogLevel
All log messages that are at a lower log level than info get logged.

WARNING

static public WARNING:LogLevel
All log messages that are at a lower log level than warning get logged.

ERROR

static public ERROR:LogLevel
All log messages that are at a lower log level than error get logged.

FATAL

static public FATAL:LogLevel
All log messages that are at a lower log level than fatal get logged.

NONE

static public NONE:LogLevel
No log messages get logged.

Method Detail

getHandler

public function getHandler(Void):LogHandler

Returns the wrapped handler not-filtered log messages are fowarded to.

Return

the wrapped handler

getLevel

public function getLevel(Void):LogLevel

Returns the lowest level messages can have that are not filtered. All messages at a lower level than the returned one are filtered.

Return

the lowest level of messages that are not filtered

write

public function write(message:LogMessage):Void

Forwards that passed-in message to the wrapped handler if the message has a higher or the same level than the specified one.

Parameters

messagethe message to forward to the wrapped handler

Specified By

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