Interface FixedLevelLogger


public interface FixedLevelLogger
A logger that logs at a fixed LogLevel.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Determine if the level is enabled.
    void
    log(String msg)
    Log a String corresponding level.
    void
    log(String format, Object arg)
    Log a message at the corresponding level according to the specified format and argument.
    void
    log(String format, Object... args)
    Log a message at the corresponding level according to the specified format and arguments.
    void
    log(String format, Object arg1, Object arg2)
    Log a message at the corresponding level according to the specified format and arguments.
    void
    log(String msg, Throwable cause)
    Log an Exception at the corresponding level with an accompanying message.
    Get the logger name.
    Get the level of this logger.
  • Method Details

    • loggerName

      String loggerName()
      Get the logger name.
      Returns:
      the logger name.
    • logLevel

      LogLevel logLevel()
      Get the level of this logger.
      Returns:
      the level of this logger.
    • isEnabled

      boolean isEnabled()
      Determine if the level is enabled.
      Returns:
      true if the level is enabled.
    • log

      void log(String msg)
      Log a String corresponding level.
      Parameters:
      msg - the message to log.
    • log

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

      void log(String format, Object arg)
      Log a message at the corresponding level according to the specified format and argument.

      This form avoids superfluous object creation when the logger is disabled for the corresponding level

      Parameters:
      format - the format string.
      arg - the argument.
    • log

      void log(String format, Object arg1, Object arg2)
      Log a message at the corresponding level according to the specified format and arguments.

      This form avoids superfluous object creation when the logger is disabled for the corresponding level.

      Parameters:
      format - the format string.
      arg1 - the first argument.
      arg2 - the second argument.
    • log

      void log(String format, Object... args)
      Log a message at the corresponding level according to the specified format and arguments.

      This form avoids superfluous string concatenation when the logger is disabled for the corresponding level. However, this variant incurs the hidden (and relatively small) cost of creating an Object[] before invoking the method, even if this logger is disabled for the corresponding level. The variants taking one and two arguments exist solely in order to avoid this hidden cost.

      Parameters:
      format - the format string.
      args - a list of 3 or more arguments.