org.apache.slide.util.logger
Interface Logger

All Known Implementing Classes:
SimpleLogger

public interface Logger

The Logger block interface.

This interface must be implemented by those blocks willing to log data coming from other blocks.

The six levels used for logging are (in order of gravity): EMERGENCY, CRITICAL, ERROR, WARNING, INFO and DEBUG.

Version:
1.0 (CVS $Revision: 1.4 $ $Date: 2001/08/01 17:51:50 $)
Author:
Federico Barbieri, Pierpaolo Fumagalli, Stefano Mazzocchi, Java Apache Project, Remy Maucherat

Field Summary
static int CRITICAL
          The CRITICAL logging level (anything logged under this level means that a critical temporary error was detected).
static int DEBUG
          The DEBUG logging level (anything logged under this level means that an debug message must be logged).
static java.lang.String DEFAULT_CHANNEL
          Specify the default string for logging without a channel.
static int EMERGENCY
          The EMERGENCY logging level (anything logged under this level means that a critical permanent error was detected).
static int ERROR
          The ERROR logging level (anything logged under this level means that a non-critical error was detected).
static int INFO
          The INFO logging level (anything logged under this level means that an informative message must be logged).
static int WARNING
          The WARNING logging level (anything logged under this level means that a generic error was detected).
 
Method Summary
 int getLoggerLevel()
          Get the logger level for the default channel
 int getLoggerLevel(java.lang.String channel)
          Get the logger level for the specified channel
 boolean isEnabled(int level)
          Check if the default channel with the specified level is enabled for logging.
 boolean isEnabled(java.lang.String channel, int level)
          Check if the channel with the specified level is enabled for logging.
 void log(java.lang.Object data)
          Log an object.
 void log(java.lang.Object data, int level)
          Log an object with the specified level.
 void log(java.lang.Object data, java.lang.String channel, int level)
          Log an object thru the specified channel and with the specified level.
 void setLoggerLevel(int level)
          Set the logger level for the default channel
 void setLoggerLevel(java.lang.String channel, int level)
          Set the logger level for the specified channel
 

Field Detail

EMERGENCY

public static final int EMERGENCY
The EMERGENCY logging level (anything logged under this level means that a critical permanent error was detected).

When a Block logs something with this level means that any other task will be impossible without administrator's intervention.

Example:


CRITICAL

public static final int CRITICAL
The CRITICAL logging level (anything logged under this level means that a critical temporary error was detected).

When a Block logs something with this level means that tasks similar to the one generating the error will be impossible without administrator's intervention, but other tasks (maybe using different resources) will be possible.

Example:


ERROR

public static final int ERROR
The ERROR logging level (anything logged under this level means that a non-critical error was detected).

When a Block logs something with this level means that the current tasks failed to execute, but the stability of the block is not compromised.

Example:


WARNING

public static final int WARNING
The WARNING logging level (anything logged under this level means that a generic error was detected).

When a Block logs something with this level means that the current tasks failed to execute due to inconsistencies in the request handled by the block.

Example:


INFO

public static final int INFO
The INFO logging level (anything logged under this level means that an informative message must be logged).

When a Block logs something with this level means that something that may be interesting happened.

Example:


DEBUG

public static final int DEBUG
The DEBUG logging level (anything logged under this level means that an debug message must be logged).

When a Block logs something with this level means that something that may be interesting while developing, tracking bugs or misconfigurations.

Example:


DEFAULT_CHANNEL

public static final java.lang.String DEFAULT_CHANNEL
Specify the default string for logging without a channel.
Method Detail

log

public void log(java.lang.Object data,
                java.lang.String channel,
                int level)
Log an object thru the specified channel and with the specified level.
Parameters:
data - The object to log.
channel - The channel name used for logging.
level - The level used for logging.

log

public void log(java.lang.Object data,
                int level)
Log an object with the specified level.
Parameters:
data - The object to log.
level - The level used for logging.

log

public void log(java.lang.Object data)
Log an object.
Parameters:
data - The object to log.

setLoggerLevel

public void setLoggerLevel(int level)
Set the logger level for the default channel
Parameters:
data - The object to log.

setLoggerLevel

public void setLoggerLevel(java.lang.String channel,
                           int level)
Set the logger level for the specified channel
Parameters:
data - The object to log.

getLoggerLevel

public int getLoggerLevel()
Get the logger level for the default channel
Parameters:
data - The object to log.

getLoggerLevel

public int getLoggerLevel(java.lang.String channel)
Get the logger level for the specified channel
Parameters:
data - The object to log.

isEnabled

public boolean isEnabled(java.lang.String channel,
                         int level)
Check if the channel with the specified level is enabled for logging.
Parameters:
channel - The channel specification
level - The level specification

isEnabled

public boolean isEnabled(int level)
Check if the default channel with the specified level is enabled for logging.
Parameters:
level - The level specification