Interface Logger

  • All Known Implementing Classes:
    JdkLogger, Slf4jLogger

    public interface Logger
    Unified logger. Pay attention that the format follows standard Formatter.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void debug​(Object format, Object... arguments)
      Logs a message at the DEBUG level according to the specified format and arguments.
      void debug​(Object message, Throwable t)
      Logs an error (see Throwable) at the DEBUG level with an accompanying message.
      void debug​(Supplier<?> function)
      Logs output of a custom function at the DEBUG level.
      void error​(Object format, Object... arguments)
      Logs a message at the ERROR level according to the specified format and arguments.
      void error​(Object message, Throwable t)
      Logs an error (see Throwable) at the ERROR level with an accompanying message.
      void error​(Supplier<?> function)
      Logs output of a custom function at the ERROR level.
      void info​(Object format, Object... arguments)
      Logs a message at the INFO level according to the specified format and arguments.
      void info​(Object message, Throwable t)
      Logs an error (see Throwable) at the INFO level with an accompanying message.
      void info​(Supplier<?> function)
      Logs output of a custom function at the INFO level.
      void trace​(Object format, Object... arguments)
      Logs a message at the TRACE level according to the specified format and arguments.
      void trace​(Object message, Throwable t)
      Logs an error (see Throwable) at the TRACE level with an accompanying message.
      void trace​(Supplier<?> function)
      Logs output of a custom function at the TRACE level.
      Object unwrap()
      Return logger implementation.
      void warn​(Object format, Object... arguments)
      Logs a message at the WARN level according to the specified format and arguments.
      void warn​(Object message, Throwable t)
      Logs an error (see Throwable) at the WRAN level with an accompanying message.
      void warn​(Supplier<?> function)
      Logs output of a custom function at the WARN level.
    • Method Detail

      • debug

        void debug​(Supplier<?> function)
        Logs output of a custom function at the DEBUG level. The function will only run when log level is DEBUG or lower.
        Parameters:
        function - custom function to run
      • debug

        void debug​(Object format,
                   Object... arguments)
        Logs a message at the DEBUG level according to the specified format and arguments.
        Parameters:
        format - the format string
        arguments - a list of arguments, the last one could be a Throwable
      • debug

        void debug​(Object message,
                   Throwable t)
        Logs an error (see Throwable) at the DEBUG level with an accompanying message.
        Parameters:
        message - the message accompanying the error
        t - the error to log
      • error

        void error​(Supplier<?> function)
        Logs output of a custom function at the ERROR level. The function will only run when log level is ERROR or lower.
        Parameters:
        function - custom function to run
      • error

        void error​(Object format,
                   Object... arguments)
        Logs a message at the ERROR level according to the specified format and arguments.
        Parameters:
        format - the format string
        arguments - a list of arguments, the last one could be a Throwable
      • error

        void error​(Object message,
                   Throwable t)
        Logs an error (see Throwable) at the ERROR level with an accompanying message.
        Parameters:
        message - the message accompanying the error
        t - the error to log
      • info

        void info​(Supplier<?> function)
        Logs output of a custom function at the INFO level. The function will only run when log level is INFO or lower.
        Parameters:
        function - custom function to run
      • info

        void info​(Object format,
                  Object... arguments)
        Logs a message at the INFO level according to the specified format and arguments.
        Parameters:
        format - the format string
        arguments - a list of arguments, the last one could be a Throwable
      • info

        void info​(Object message,
                  Throwable t)
        Logs an error (see Throwable) at the INFO level with an accompanying message.
        Parameters:
        message - the message accompanying the error
        t - the error to log
      • trace

        void trace​(Supplier<?> function)
        Logs output of a custom function at the TRACE level. The function will only run when log level is TRACE.
        Parameters:
        function - custom function to run
      • trace

        void trace​(Object format,
                   Object... arguments)
        Logs a message at the TRACE level according to the specified format and arguments.
        Parameters:
        format - the format string
        arguments - a list of arguments, the last one could be a Throwable
      • trace

        void trace​(Object message,
                   Throwable t)
        Logs an error (see Throwable) at the TRACE level with an accompanying message.
        Parameters:
        message - the message accompanying the error
        t - the error to log
      • warn

        void warn​(Supplier<?> function)
        Logs output of a custom function at the WARN level. The function will only run when log level is WARN or lower.
        Parameters:
        function - custom function to run
      • warn

        void warn​(Object format,
                  Object... arguments)
        Logs a message at the WARN level according to the specified format and arguments.
        Parameters:
        format - the format string
        arguments - a list of arguments, the last one could be a Throwable
      • warn

        void warn​(Object message,
                  Throwable t)
        Logs an error (see Throwable) at the WRAN level with an accompanying message.
        Parameters:
        message - the message accompanying the error
        t - the error to log
      • unwrap

        Object unwrap()
        Return logger implementation.
        Returns:
        implementation