接口 Logger


public interface Logger
Logger interface designed for internal usage.
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    Log a message at the DEBUG level.
    void
    debug(String format, Object... arguments)
    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... arguments)
    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.
    Return the name of this Logger instance.
    void
    info(String msg)
    Log a message at the INFO level.
    void
    info(String format, Object... arguments)
    Log a message at the INFO level according to the specified format and arguments.
    void
    Log an exception (throwable) at the INFO level with an accompanying message.
    boolean
    Is the logger instance enabled for the DEBUG level?
    boolean
    Is the logger instance enabled for the ERROR level?
    boolean
    Is the logger instance enabled for the INFO level?
    boolean
    Is the logger instance enabled for the TRACE level?
    boolean
    Is the logger instance enabled for the WARN level?
    void
    Log a message at the TRACE level.
    void
    trace(String format, Object... arguments)
    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... arguments)
    Log a message at the WARN level according to the specified format and arguments.
    void
    Log an exception (throwable) at the WARN level with an accompanying message.
  • 方法详细资料

    • getName

      String getName()
      Return the name of this Logger instance.
      返回:
      name of this logger instance
    • isTraceEnabled

      boolean isTraceEnabled()
      Is the logger instance enabled for the TRACE level?
      返回:
      True if this Logger is enabled for the TRACE level, false otherwise.
    • trace

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

      void trace(String format, Object... arguments)
      Log a message at the TRACE level according to the specified format and arguments.

      This form avoids superfluous string concatenation when the logger is disabled for the TRACE 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 TRACE.

      参数:
      format - the format string
      arguments - a list of 3 or more arguments
    • trace

      void trace(String msg, Throwable t)
      Log an exception (throwable) at the TRACE level with an accompanying message.
      参数:
      msg - the message accompanying the exception
      t - the exception (throwable) to log
    • isDebugEnabled

      boolean isDebugEnabled()
      Is the logger instance enabled for the DEBUG level?
      返回:
      True if this Logger is enabled for the DEBUG level, false otherwise.
    • debug

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

      void debug(String format, Object... arguments)
      Log a message at the DEBUG level according to the specified format and arguments.

      This form avoids superfluous string concatenation when the logger is disabled for the DEBUG 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 DEBUG.

      参数:
      format - the format string
      arguments - a list of 3 or more arguments
    • debug

      void debug(String msg, Throwable t)
      Log an exception (throwable) at the DEBUG level with an accompanying message.
      参数:
      msg - the message accompanying the exception
      t - the exception (throwable) to log
    • isInfoEnabled

      boolean isInfoEnabled()
      Is the logger instance enabled for the INFO level?
      返回:
      True if this Logger is enabled for the INFO level, false otherwise.
    • info

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

      void info(String format, Object... arguments)
      Log a message at the INFO level according to the specified format and arguments.

      This form avoids superfluous string concatenation when the logger is disabled for the INFO 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 INFO.

      参数:
      format - the format string
      arguments - a list of 3 or more arguments
    • info

      void info(String msg, Throwable t)
      Log an exception (throwable) at the INFO level with an accompanying message.
      参数:
      msg - the message accompanying the exception
      t - the exception (throwable) to log
    • isWarnEnabled

      boolean isWarnEnabled()
      Is the logger instance enabled for the WARN level?
      返回:
      True if this Logger is enabled for the WARN level, false otherwise.
    • warn

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

      void warn(String format, Object... arguments)
      Log a message at the WARN level according to the specified format and arguments.

      This form avoids superfluous string concatenation when the logger is disabled for the WARN 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 WARN.

      参数:
      format - the format string
      arguments - a list of 3 or more arguments
    • warn

      void warn(String msg, Throwable t)
      Log an exception (throwable) at the WARN level with an accompanying message.
      参数:
      msg - the message accompanying the exception
      t - the exception (throwable) to log
    • isErrorEnabled

      boolean isErrorEnabled()
      Is the logger instance enabled for the ERROR level?
      返回:
      True if this Logger is enabled for the ERROR level, false otherwise.
    • error

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

      void error(String format, Object... arguments)
      Log a message at the ERROR level according to the specified format and arguments.

      This form avoids superfluous string concatenation when the logger is disabled for the ERROR 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 ERROR.

      参数:
      format - the format string
      arguments - a list of 3 or more arguments
    • error

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