Class Logging


  • public final class Logging
    extends Object
    • Field Detail

      • LOGGER_FATAL

        public static final org.slf4j.Marker LOGGER_FATAL
    • 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 with
        errorMessage - 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 to
        exception - 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 to
        message - the message to be logged and put on the thrown RuntimeException