Class Slf4jLogger

  • All Implemented Interfaces:
    Logger

    public class Slf4jLogger
    extends Object
    implements Logger
    Adaptor for slf4j logger.
    • Constructor Summary

      Constructors 
      Constructor Description
      Slf4jLogger​(org.slf4j.Logger logger)
      Default constructor.
    • Constructor Detail

      • Slf4jLogger

        public Slf4jLogger​(org.slf4j.Logger logger)
        Default constructor.
        Parameters:
        logger - non-null SLF4J logger
    • Method Detail

      • debug

        public void debug​(Supplier<?> function)
        Description copied from interface: Logger
        Logs output of a custom function at the DEBUG level. The function will only run when log level is DEBUG or lower.
        Specified by:
        debug in interface Logger
        Parameters:
        function - custom function to run
      • debug

        public void debug​(Object format,
                          Object... arguments)
        Description copied from interface: Logger
        Logs a message at the DEBUG level according to the specified format and arguments.
        Specified by:
        debug in interface Logger
        Parameters:
        format - the format string
        arguments - a list of arguments, the last one could be a Throwable
      • debug

        public void debug​(Object message,
                          Throwable t)
        Description copied from interface: Logger
        Logs an error (see Throwable) at the DEBUG level with an accompanying message.
        Specified by:
        debug in interface Logger
        Parameters:
        message - the message accompanying the error
        t - the error to log
      • error

        public void error​(Supplier<?> function)
        Description copied from interface: Logger
        Logs output of a custom function at the ERROR level. The function will only run when log level is ERROR or lower.
        Specified by:
        error in interface Logger
        Parameters:
        function - custom function to run
      • error

        public void error​(Object format,
                          Object... arguments)
        Description copied from interface: Logger
        Logs a message at the ERROR level according to the specified format and arguments.
        Specified by:
        error in interface Logger
        Parameters:
        format - the format string
        arguments - a list of arguments, the last one could be a Throwable
      • error

        public void error​(Object message,
                          Throwable t)
        Description copied from interface: Logger
        Logs an error (see Throwable) at the ERROR level with an accompanying message.
        Specified by:
        error in interface Logger
        Parameters:
        message - the message accompanying the error
        t - the error to log
      • info

        public void info​(Supplier<?> function)
        Description copied from interface: Logger
        Logs output of a custom function at the INFO level. The function will only run when log level is INFO or lower.
        Specified by:
        info in interface Logger
        Parameters:
        function - custom function to run
      • info

        public void info​(Object format,
                         Object... arguments)
        Description copied from interface: Logger
        Logs a message at the INFO level according to the specified format and arguments.
        Specified by:
        info in interface Logger
        Parameters:
        format - the format string
        arguments - a list of arguments, the last one could be a Throwable
      • info

        public void info​(Object message,
                         Throwable t)
        Description copied from interface: Logger
        Logs an error (see Throwable) at the INFO level with an accompanying message.
        Specified by:
        info in interface Logger
        Parameters:
        message - the message accompanying the error
        t - the error to log
      • trace

        public void trace​(Supplier<?> function)
        Description copied from interface: Logger
        Logs output of a custom function at the TRACE level. The function will only run when log level is TRACE.
        Specified by:
        trace in interface Logger
        Parameters:
        function - custom function to run
      • trace

        public void trace​(Object format,
                          Object... arguments)
        Description copied from interface: Logger
        Logs a message at the TRACE level according to the specified format and arguments.
        Specified by:
        trace in interface Logger
        Parameters:
        format - the format string
        arguments - a list of arguments, the last one could be a Throwable
      • trace

        public void trace​(Object message,
                          Throwable t)
        Description copied from interface: Logger
        Logs an error (see Throwable) at the TRACE level with an accompanying message.
        Specified by:
        trace in interface Logger
        Parameters:
        message - the message accompanying the error
        t - the error to log
      • warn

        public void warn​(Supplier<?> function)
        Description copied from interface: Logger
        Logs output of a custom function at the WARN level. The function will only run when log level is WARN or lower.
        Specified by:
        warn in interface Logger
        Parameters:
        function - custom function to run
      • warn

        public void warn​(Object format,
                         Object... arguments)
        Description copied from interface: Logger
        Logs a message at the WARN level according to the specified format and arguments.
        Specified by:
        warn in interface Logger
        Parameters:
        format - the format string
        arguments - a list of arguments, the last one could be a Throwable
      • warn

        public void warn​(Object message,
                         Throwable t)
        Description copied from interface: Logger
        Logs an error (see Throwable) at the WRAN level with an accompanying message.
        Specified by:
        warn in interface Logger
        Parameters:
        message - the message accompanying the error
        t - the error to log
      • unwrap

        public Object unwrap()
        Description copied from interface: Logger
        Return logger implementation.
        Specified by:
        unwrap in interface Logger
        Returns:
        implementation