Package de.dlr.gitlab.fame.logging
Class Logging
- java.lang.Object
-
- de.dlr.gitlab.fame.logging.Logging
-
public final class Logging extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Marker
LOGGER_FATAL
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
logAndThrowFatal(org.slf4j.Logger logger, String message)
Throws a new RuntimeException and logs its message at logging level FATALstatic <T extends RuntimeException>
voidlogAndThrowFatal(org.slf4j.Logger logger, T exception)
Throws the given uncaught Exception and logs its message at logging level FATALstatic RuntimeException
logFatalException(org.slf4j.Logger logger, String errorMessage)
Returns a RuntimeException with given error message and logs a fatal error at given logger
Important: Remember to actually throw the returned Exception!
-
-
-
Method Detail
-
logFatalException
public static RuntimeException logFatalException(org.slf4j.Logger logger, String errorMessage)
Returns a RuntimeException with given error message and logs a fatal error at given logger
Important: Remember to actually throw the returned Exception!- Parameters:
logger
- to log the given message witherrorMessage
- to be logged and added to exception- Returns:
RuntimeException
with given error message
-
logAndThrowFatal
public static <T extends RuntimeException> void logAndThrowFatal(org.slf4j.Logger logger, T exception)
Throws the given uncaught Exception and logs its message at logging level FATAL- Type Parameters:
T
- Type of the exception- Parameters:
logger
- logger to append the exception's message toexception
- the new Exception (including any specified exception message to be logged)
-
logAndThrowFatal
public static void logAndThrowFatal(org.slf4j.Logger logger, String message)
Throws a new RuntimeException and logs its message at logging level FATAL- Parameters:
logger
- logger to append the exception's message tomessage
- the message to be logged and put on the thrown RuntimeException
-
-