Class LogMessage


  • public final class LogMessage
    extends Object
    Log message with arguments and/or error.
    • Method Detail

      • of

        public static LogMessage of​(Object format,
                                    Object... arguments)
        Creates a log message with arguments. The latest argument could be a java.lang.Throwable providing details like stack trace of an error.
        Parameters:
        format - Object format, could be null
        arguments - arguments, could be null or empty
        Returns:
        log message
      • getMessage

        public String getMessage()
        Gets log message.
        Returns:
        non-null log message
      • getThrowable

        public Throwable getThrowable()
        Gets error which may or may not be null.
        Returns:
        error, could be null
      • hasThrowable

        public boolean hasThrowable()
        Checks if error is available or not.
        Returns:
        true if there's error; false otherwise