Class Logger


  • public final class Logger
    extends Object
    • Method Detail

      • logger

        public org.slf4j.Logger logger()
      • info

        public void info​(Supplier<String> msg)
        Checks if info is enabled and if so logs the supplied message
        Parameters:
        msg - - supplier for the log message
      • info

        public void info​(Supplier<String> msg,
                         Throwable throwable)
        Checks if info is enabled and if so logs the supplied message and exception
        Parameters:
        msg - - supplier for the log message
        throwable - - a throwable to log
      • error

        public void error​(Supplier<String> msg)
        Checks if error is enabled and if so logs the supplied message
        Parameters:
        msg - - supplier for the log message
      • error

        public void error​(Supplier<String> msg,
                          Throwable throwable)
        Checks if error is enabled and if so logs the supplied message and exception
        Parameters:
        msg - - supplier for the log message
        throwable - - a throwable to log
      • debug

        public void debug​(Supplier<String> msg)
        Checks if debug is enabled and if so logs the supplied message
        Parameters:
        msg - - supplier for the log message
      • debug

        public void debug​(Supplier<String> msg,
                          Throwable throwable)
        Checks if debug is enabled and if so logs the supplied message and exception
        Parameters:
        msg - - supplier for the log message
        throwable - - a throwable to log
      • warn

        public void warn​(Supplier<String> msg)
        Checks if warn is enabled and if so logs the supplied message
        Parameters:
        msg - - supplier for the log message
      • warn

        public void warn​(Supplier<String> msg,
                         Throwable throwable)
        Checks if warn is enabled and if so logs the supplied message and exception
        Parameters:
        msg - - supplier for the log message
        throwable - - a throwable to log
      • trace

        public void trace​(Supplier<String> msg)
        Checks if trace is enabled and if so logs the supplied message
        Parameters:
        msg - - supplier for the log message
      • trace

        public void trace​(Supplier<String> msg,
                          Throwable throwable)
        Checks if trace is enabled and if so logs the supplied message and exception
        Parameters:
        msg - - supplier for the log message
        throwable - - a throwable to log
      • isLoggingLevelEnabled

        public boolean isLoggingLevelEnabled​(org.slf4j.event.Level logLevel)
        Determines if the provided log-level is enabled.
        Parameters:
        logLevel - the SLF4J log level enum
        Returns:
        whether that level is enabled
      • isLoggingLevelEnabled

        public boolean isLoggingLevelEnabled​(String logLevel)
        Determines if the log-level passed is enabled
        Parameters:
        logLevel - a string representation of the log level, e.g. "debug"
        Returns:
        whether or not that level is enable
      • log

        public void log​(org.slf4j.event.Level logLevel,
                        Supplier<String> msg)
        Log a message at the given log level (if it is enabled).
        Parameters:
        logLevel - the SLF4J log level
        msg - supplier for the log message
      • loggerFor

        public static Logger loggerFor​(Class<?> clz)
        Static factory to get a logger instance for a given class
        Parameters:
        clz - - class to get the logger for
        Returns:
        a Logger instance
      • loggerFor

        public static Logger loggerFor​(String name)
        Static factory to get a logger instance with a specific name.
        Parameters:
        name - - The name of the logger to create
        Returns:
        a Logger instance