Class LogUtil


  • public class LogUtil
    extends Object
    This class helps logging in a performant manner.
    • Constructor Detail

      • LogUtil

        public LogUtil()
    • Method Detail

      • trace

        public static final void trace​(org.apache.commons.logging.Log log,
                                       String format,
                                       Object... arguments)
        This method prints a trace message into a given log with given message objects. The message is formatted using printf(String, Object...) with given objects. The formatting needs only be done if trace logging is enabled.
        Parameters:
        log - The Log instance.
        format - The formattable messaage.
        arguments - The message objects formatted into the massage.
      • debug

        public static final void debug​(org.apache.commons.logging.Log log,
                                       String format,
                                       Object... arguments)
        This method prints a debug message into a given log with given message objects. The message is formatted using printf(String, Object...) with given objects. The formatting needs only be done if debug logging is enabled.
        Parameters:
        log - The Log instance.
        format - The formattable messaage.
        arguments - The message objects formatted into the massage.
      • info

        public static final void info​(org.apache.commons.logging.Log log,
                                      String format,
                                      Object... arguments)
        This method prints an info message into a given log with given message objects. The message is formatted using printf(String, Object...) with given objects. The formatting needs only be done if info logging is enabled.
        Parameters:
        log - The Log instance.
        format - The formattable messaage.
        arguments - The message objects formatted into the massage.
      • warn

        public static final void warn​(org.apache.commons.logging.Log log,
                                      String format,
                                      Object... arguments)
        This method prints a warn message into a given log with given message objects. The message is formatted using printf(String, Object...) with given objects. The formatting needs only be done if warn logging is enabled.
        Parameters:
        log - The Log instance.
        format - The formattable messaage.
        arguments - The message objects formatted into the massage.
      • error

        public static final void error​(org.apache.commons.logging.Log log,
                                       String format,
                                       Object... arguments)
        This method prints an error message into a given log with given message objects. The message is formatted using printf(String, Object...) with given objects. The formatting needs only be done if error logging is enabled.
        Parameters:
        log - The Log instance.
        format - The formattable messaage.
        arguments - The message objects formatted into the massage.
      • isEmpty

        public static final boolean isEmpty​(String input)
        This method tests a given String if it is null or has zero length.
        Parameters:
        input - The String object to test.
        Returns:
        true if given text is null or has zero length.
      • banner

        public static String banner​(String key,
                                    String product)
        This method builds a standard startup banner using the bundle name and the version string extracted from the resource bundle.
        Parameters:
        key - The resource bundle key to use.
        product - The product name.
        Returns:
        The banner string to display.