org.pf.logging
Interface Logger

All Known Implementing Classes:
NilLogger, PrintStreamLogger

public interface Logger

A simple interface for all necessary logging functions. Different kinds of logging components like log4j or JLog or JDK 1.4 java.util.logging can be wrapped in an implementation that supports this interface. So programming against this interface means, to stay independent of the underlying logging component.

Version:
1.1
Author:
Manfred Duchrow

Method Summary
 void initialize(java.util.Properties properties)
          Initialize the logger from the given properties settings.
 boolean isLoggingDebugs()
          Returns true, if debug messages will be written to the output device(s).
 boolean isLoggingErrors()
          Returns true, if errors will be written to the output device(s).
 boolean isLoggingInfos()
          Returns true, if info messages will be written to the output device(s).
 boolean isLoggingWarnings()
          Returns true, if warnings will be written to the output device(s).
 void logDebug(java.lang.String message)
          If the logging level is DEBUG the given message will be written to the log output device(s).
 void logError(java.lang.String message)
          If the logging level is DEBUG, INFO, WARNING or ERROR the given message will be written to the log output device(s).
 void logError(java.lang.String message, java.lang.Throwable exception)
          If the logging level is DEBUG, INFO, WARNING or ERROR the given message and the exception will be written to the log output device(s).
 void logException(java.lang.Throwable ex)
          Writes the given exception to the log output device(s).
 void logInfo(java.lang.String message)
          If the logging level is INFO or DEBUG the given message will be written to the log output device(s).
 void logWarning(java.lang.String message)
          If the logging level is DEBUG, INFO or WARNING the given message will be written to the log output device(s).
 void logWarning(java.lang.String message, java.lang.Throwable exception)
          If the logging level is DEBUG, INFO or WARNING the given message and the exception will be written to the log output device(s).
 boolean setLogLevel(java.lang.String logLevel)
          Changes the log level to the specified level.
 

Method Detail

initialize

void initialize(java.util.Properties properties)
Initialize the logger from the given properties settings.


logException

void logException(java.lang.Throwable ex)
Writes the given exception to the log output device(s). The log level will be ignored.


logDebug

void logDebug(java.lang.String message)
If the logging level is DEBUG the given message will be written to the log output device(s).


logInfo

void logInfo(java.lang.String message)
If the logging level is INFO or DEBUG the given message will be written to the log output device(s).


logWarning

void logWarning(java.lang.String message)
If the logging level is DEBUG, INFO or WARNING the given message will be written to the log output device(s).


logError

void logError(java.lang.String message)
If the logging level is DEBUG, INFO, WARNING or ERROR the given message will be written to the log output device(s).


logWarning

void logWarning(java.lang.String message,
                java.lang.Throwable exception)
If the logging level is DEBUG, INFO or WARNING the given message and the exception will be written to the log output device(s).


logError

void logError(java.lang.String message,
              java.lang.Throwable exception)
If the logging level is DEBUG, INFO, WARNING or ERROR the given message and the exception will be written to the log output device(s).


isLoggingDebugs

boolean isLoggingDebugs()
Returns true, if debug messages will be written to the output device(s).


isLoggingInfos

boolean isLoggingInfos()
Returns true, if info messages will be written to the output device(s).


isLoggingWarnings

boolean isLoggingWarnings()
Returns true, if warnings will be written to the output device(s).


isLoggingErrors

boolean isLoggingErrors()
Returns true, if errors will be written to the output device(s).


setLogLevel

boolean setLogLevel(java.lang.String logLevel)
Changes the log level to the specified level. Returns true if the level is supported and was set, otherwise false.