Interface Logger

All Known Implementing Classes:
FallbackLogger

public interface Logger
A logger. Basic interface taken over from SLF4j except for markers. The format for parameterized log messages is that of SLF4J, i.e., {} in the message are substituted in the order of given arguments.
Author:
Holger Eichelberger, SSE, SLF4J
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Finally emits the log message.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Case insensitive String constant used to retrieve the name of the root logger.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Log a message at the DEBUG level.
    void
    debug(String format, Object arg)
    Log a message at the DEBUG level according to the specified format and argument.
    void
    debug(String format, Object... arguments)
    Log a message at the DEBUG level according to the specified format and arguments.
    void
    debug(String format, Object arg1, Object arg2)
    Log a message at the DEBUG level according to the specified format and arguments.
    void
    Log an exception (throwable) at the DEBUG level with an accompanying message.
    void
    Log a message at the ERROR level.
    void
    error(String format, Object arg)
    Log a message at the ERROR level according to the specified format and argument.
    void
    error(String format, Object... arguments)
    Log a message at the ERROR level according to the specified format and arguments.
    void
    error(String format, Object arg1, Object arg2)
    Log a message at the ERROR level according to the specified format and arguments.
    void
    Log an exception (throwable) at the ERROR level with an accompanying message.
    Returns the log level.
    Returns the name of the logger.
    void
    info(String msg)
    Log a message at the INFO level.
    void
    info(String format, Object arg)
    Log a message at the INFO level according to the specified format and argument.
    void
    info(String format, Object... arguments)
    Log a message at the INFO level according to the specified format and arguments.
    void
    info(String format, Object arg1, Object arg2)
    Log a message at the INFO level according to the specified format and arguments.
    void
    info(String msg, Throwable th)
    Log an exception (throwable) at the INFO level with an accompanying message.
    default void
    log(LogLevel level, String msg)
    Log a message at the given level.
    default void
    log(LogLevel level, String format, Object arg)
    Log a message at the given level.
    default void
    log(LogLevel level, String format, Object... arguments)
    Log a message at the given level.
    default void
    log(LogLevel level, String format, Object arg1, Object arg2)
    Log a message at the given level.
    default void
    log(LogLevel level, String msg, Throwable th)
    Log a message at the given level.
    default boolean
    Sets the emitter so that the output format can be changed programmatically.
    boolean
    Sets the log level.
    void
    Log a message at the TRACE level.
    void
    trace(String format, Object arg)
    Log a message at the TRACE level according to the specified format and argument.
    void
    trace(String format, Object... arguments)
    Log a message at the TRACE level according to the specified format and arguments.
    void
    trace(String format, Object arg1, Object arg2)
    Log a message at the TRACE level according to the specified format and arguments.
    void
    Log an exception (throwable) at the TRACE level with an accompanying message.
    void
    warn(String msg)
    Log a message at the WARN level.
    void
    warn(String format, Object arg)
    Log a message at the WARN level according to the specified format and argument.
    void
    warn(String format, Object... arguments)
    Log a message at the WARN level according to the specified format and arguments.
    void
    warn(String format, Object arg1, Object arg2)
    Log a message at the WARN level according to the specified format and arguments.
    void
    warn(String msg, Throwable th)
    Log an exception (throwable) at the WARN level with an accompanying message.
  • Field Details

    • ROOT_LOGGER_NAME

      static final String ROOT_LOGGER_NAME
      Case insensitive String constant used to retrieve the name of the root logger.
      See Also:
  • Method Details

    • setEmitter

      default boolean setEmitter(Logger.Emitter emitter)
      Sets the emitter so that the output format can be changed programmatically. May not be supported by all loggers.
      Parameters:
      emitter - the emitter, shall be ignored if null
      Returns:
      true if accepted, false if ignored
    • setLevel

      boolean setLevel(LogLevel level)
      Sets the log level.
      Parameters:
      level - the new log level
      Returns:
      true if successful and changed, false if not changed or ignored
    • getLevel

      LogLevel getLevel()
      Returns the log level.
      Returns:
      the log level, may be null if not accessible/unknown
    • getName

      String getName()
      Returns the name of the logger.
      Returns:
      the name of the logger
    • trace

      void trace(String msg)
      Log a message at the TRACE level.
      Parameters:
      msg - the message string to be logged
    • trace

      void trace(String format, Object arg)
      Log a message at the TRACE level according to the specified format and argument.
      Parameters:
      format - the format string
      arg - the argument
    • trace

      void trace(String format, Object arg1, Object arg2)
      Log a message at the TRACE level according to the specified format and arguments.
      Parameters:
      format - the format string
      arg1 - the first argument
      arg2 - the second argument
    • trace

      void trace(String format, Object... arguments)
      Log a message at the TRACE level according to the specified format and arguments.
      Parameters:
      format - the format string
      arguments - a list of 3 or more arguments
    • trace

      void trace(String msg, Throwable th)
      Log an exception (throwable) at the TRACE level with an accompanying message.
      Parameters:
      msg - the message accompanying the exception
      th - the exception (throwable) to log
    • debug

      void debug(String msg)
      Log a message at the DEBUG level.
      Parameters:
      msg - the message string to be logged
    • debug

      void debug(String format, Object arg)
      Log a message at the DEBUG level according to the specified format and argument.
      Parameters:
      format - the format string
      arg - the argument
    • debug

      void debug(String format, Object arg1, Object arg2)
      Log a message at the DEBUG level according to the specified format and arguments.
      Parameters:
      format - the format string
      arg1 - the first argument
      arg2 - the second argument
    • debug

      void debug(String format, Object... arguments)
      Log a message at the DEBUG level according to the specified format and arguments.
      Parameters:
      format - the format string
      arguments - a list of 3 or more arguments
    • debug

      void debug(String msg, Throwable th)
      Log an exception (throwable) at the DEBUG level with an accompanying message.
      Parameters:
      msg - the message accompanying the exception
      th - the exception (throwable) to log
    • info

      void info(String msg)
      Log a message at the INFO level.
      Parameters:
      msg - the message string to be logged
    • info

      void info(String format, Object arg)
      Log a message at the INFO level according to the specified format and argument.
      Parameters:
      format - the format string
      arg - the argument
    • info

      void info(String format, Object arg1, Object arg2)
      Log a message at the INFO level according to the specified format and arguments.
      Parameters:
      format - the format string
      arg1 - the first argument
      arg2 - the second argument
    • info

      void info(String format, Object... arguments)
      Log a message at the INFO level according to the specified format and arguments.
      Parameters:
      format - the format string
      arguments - a list of 3 or more arguments
    • info

      void info(String msg, Throwable th)
      Log an exception (throwable) at the INFO level with an accompanying message.
      Parameters:
      msg - the message accompanying the exception
      th - the exception (throwable) to log
    • warn

      void warn(String msg)
      Log a message at the WARN level.
      Parameters:
      msg - the message string to be logged
    • warn

      void warn(String format, Object arg)
      Log a message at the WARN level according to the specified format and argument.
      Parameters:
      format - the format string
      arg - the argument
    • warn

      void warn(String format, Object arg1, Object arg2)
      Log a message at the WARN level according to the specified format and arguments.
      Parameters:
      format - the format string
      arg1 - the first argument
      arg2 - the second argument
    • warn

      void warn(String format, Object... arguments)
      Log a message at the WARN level according to the specified format and arguments.
      Parameters:
      format - the format string
      arguments - a list of 3 or more arguments
    • warn

      void warn(String msg, Throwable th)
      Log an exception (throwable) at the WARN level with an accompanying message.
      Parameters:
      msg - the message accompanying the exception
      th - the exception (throwable) to log
    • error

      void error(String msg)
      Log a message at the ERROR level.
      Parameters:
      msg - the message string to be logged
    • error

      void error(String format, Object arg)
      Log a message at the ERROR level according to the specified format and argument.
      Parameters:
      format - the format string
      arg - the argument
    • error

      void error(String format, Object arg1, Object arg2)
      Log a message at the ERROR level according to the specified format and arguments.
      Parameters:
      format - the format string
      arg1 - the first argument
      arg2 - the second argument
    • error

      void error(String format, Object... arguments)
      Log a message at the ERROR level according to the specified format and arguments.
      Parameters:
      format - the format string
      arguments - a list of 3 or more arguments
    • error

      void error(String msg, Throwable th)
      Log an exception (throwable) at the ERROR level with an accompanying message.
      Parameters:
      msg - the message accompanying the exception
      th - the exception (throwable) to log
    • log

      default void log(LogLevel level, String msg)
      Log a message at the given level.
      Parameters:
      level - the logging level to use (LogLevel.ALL and LogLevel.OFF are ignored)
      msg - the message string to be logged
    • log

      default void log(LogLevel level, String format, Object arg)
      Log a message at the given level.
      Parameters:
      level - the logging level to use (LogLevel.ALL and LogLevel.OFF are ignored)
      format - the format string
      arg - the argument
    • log

      default void log(LogLevel level, String format, Object arg1, Object arg2)
      Log a message at the given level.
      Parameters:
      level - the logging level to use (LogLevel.ALL and LogLevel.OFF are ignored)
      format - the format string
      arg1 - the first argument
      arg2 - the second argument
    • log

      default void log(LogLevel level, String format, Object... arguments)
      Log a message at the given level.
      Parameters:
      level - the logging level to use (LogLevel.ALL and LogLevel.OFF are ignored)
      format - the format string
      arguments - a list of 3 or more arguments
    • log

      default void log(LogLevel level, String msg, Throwable th)
      Log a message at the given level.
      Parameters:
      level - the logging level to use (LogLevel.ALL and LogLevel.OFF are ignored)
      msg - the message accompanying the exception
      th - the exception (throwable) to log