org.jlog2.exception
Class ExceptionHandler
java.lang.Object
org.jlog2.exception.ExceptionHandler
public class ExceptionHandler
- extends java.lang.Object
This class handles the exception and logs a message depending on the type of exception.
Method Summary |
static void |
debugException(Logger logger,
java.lang.String level,
java.lang.String methodName,
java.lang.String message,
java.lang.Exception error)
Write the exception to the debug channels if the logger allows debugging
at the specified level. |
static java.lang.Exception |
handleException(Logger logger,
java.lang.String level,
java.lang.String methodName,
java.lang.String message,
java.lang.Exception error)
Handle the exception depending on its type and log an error message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExceptionHandler
public ExceptionHandler()
handleException
public static java.lang.Exception handleException(Logger logger,
java.lang.String level,
java.lang.String methodName,
java.lang.String message,
java.lang.Exception error)
- Handle the exception depending on its type and log an error message.
- Parameters:
logger
- the logger.level
- the error level.methodName
- the name of the method in the class throwing the exception.message
- an additional message to output as well as the error.error
- the exception to process.
- Returns:
- the exception to be processed further in code.
debugException
public static void debugException(Logger logger,
java.lang.String level,
java.lang.String methodName,
java.lang.String message,
java.lang.Exception error)
- Write the exception to the debug channels if the logger allows debugging
at the specified level.
- Parameters:
logger
- the logger.level
- the error level.methodName
- the name of the method in the class throwing the exception.message
- an additional message to output as well as the error.error
- the exception to process.