com.sdm.quasar.client.core.common.logging
Interface LogHandler

All Known Implementing Classes:
Log4JLogHandler, SimpleConsoleLogHandler

public interface LogHandler

Interface for the adapter between the LogManager and the logging framework actually used.

Version:
1.0
Author:
Bernd Olleck, Thomas Wolf

Method Summary
 boolean handles(int loggingLevel, CallerInformation callerInformation)
          Returns true, if the LogHandler can handle logging messages for the calling logger and logging level.
 boolean isLogging(int loggingLevel, CallerInformation callerInformation)
          Tests, whether messages will be logged at the given logging level
 void log(int loggingLevel, CallerInformation callerInformation, java.lang.String message, java.lang.Throwable exception)
          Logs a message including an optional exception if logging is enabled for the specified calling logger and logging level.
 

Method Detail

handles

public boolean handles(int loggingLevel,
                       CallerInformation callerInformation)
Returns true, if the LogHandler can handle logging messages for the calling logger and logging level.

Parameters:
loggingLevel - the level to be logged, one of the constants from LoggingLevel
callerInformation - stores information about the logger caller (garanteed to be not null)
Returns:
true, iff this LogHandler can handle logging messages for the logger class and logging level given

isLogging

public boolean isLogging(int loggingLevel,
                         CallerInformation callerInformation)
Tests, whether messages will be logged at the given logging level

Parameters:
loggingLevel - the level to be logged, one of the constants from LoggingLevel
callerInformation - stores information about the logger caller (garanteed to be not null)
Returns:
true, iff messages will be logged at the given level

log

public void log(int loggingLevel,
                CallerInformation callerInformation,
                java.lang.String message,
                java.lang.Throwable exception)
Logs a message including an optional exception if logging is enabled for the specified calling logger and logging level.

Parameters:
loggingLevel - the level to be logged, one of the constants from LoggingLevel
callerInformation - stores information about the logger caller (garanteed to be not null)
message - the message to be logged (may be null)
exception - the exception to be logged (may be null)