类 Logger

java.lang.Object
cn.taketoday.logging.Logger
所有已实现的接口:
Serializable
直接已知子类:
NoOpLogger

public abstract class Logger extends Object implements Serializable
Logger From slf4j
作者:
TODAY
2019-11-03 13:15
另请参阅:
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    protected final boolean
     
    protected static final String
     
  • 构造器概要

    构造器
    限定符
    构造器
    说明
    protected
    Logger(boolean debugEnabled)
     
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    debug(Object message)
    Logs a message with debug log level.
    void
    debug(Object message, Throwable t)
    Logs an error with debug log level.
    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
    error(Object message)
    Logs a message with error log level.
    void
    error(Object message, Throwable t)
    Logs an error with error log level.
    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
    error(String format, Object arg1, Object arg2, Throwable throwable)
     
    void
    error(String format, Object arg, Throwable throwable)
     
    void
    Log an exception (throwable) at the ERROR level with an accompanying message.
    abstract String
    Return the name of this Logger instance.
    void
    info(Object message)
    Logs a message with info log level.
    void
    info(Object message, Throwable t)
    Logs an error with info log level.
    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
    Log an exception (throwable) at the INFO level with an accompanying message.
    boolean
    Is the logger instance enabled for the DEBUG level?
    abstract boolean
    Is the logger instance enabled for the ERROR level?
    abstract boolean
    Is the logger instance enabled for the INFO level?
    abstract boolean
    Is the logger instance enabled for the TRACE level?
    abstract boolean
    Is the logger instance enabled for the WARN level?
    protected abstract void
    logInternal(Level level, Object msg, Throwable t)
     
    protected abstract void
    logInternal(Level level, String msg, Throwable t, Object[] args)
     
    void
    trace(Object message)
    Logs a message with trace log level.
    void
    trace(Object message, Throwable t)
    Logs an error with trace 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(Object message)
    Logs a message with warn log level.
    void
    warn(Object message, Throwable t)
    Logs an error with warn log level.
    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
    Log an exception (throwable) at the WARN level with an accompanying message.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • FQCN

      protected static final String FQCN
    • debugEnabled

      protected final boolean debugEnabled
  • 构造器详细资料

    • Logger

      protected Logger(boolean debugEnabled)
  • 方法详细资料

    • getName

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

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

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

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

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

      参数:
      format - the format string
      arg - the argument
    • trace

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

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

      参数:
      format - the format string
      arg1 - the first argument
      arg2 - the second argument
    • trace

      public 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. The variants taking one and two arguments exist solely in order to avoid this hidden cost.

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

      public 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

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

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

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

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

      参数:
      format - the format string
      arg - the argument
    • debug

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

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

      参数:
      format - the format string
      arg1 - the first argument
      arg2 - the second argument
    • debug

      public 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. The variants taking one and two arguments exist solely in order to avoid this hidden cost.

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

      public 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

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

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

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

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

      参数:
      format - the format string
      arg - the argument
    • info

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

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

      参数:
      format - the format string
      arg1 - the first argument
      arg2 - the second argument
    • info

      public 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. The variants taking one and two arguments exist solely in order to avoid this hidden cost.

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

      public 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

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

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

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

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

      参数:
      format - the format string
      arg - the argument
    • warn

      public 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. The variants taking one and two arguments exist solely in order to avoid this hidden cost.

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

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

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

      参数:
      format - the format string
      arg1 - the first argument
      arg2 - the second argument
    • warn

      public 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

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

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

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

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

      参数:
      format - the format string
      arg - the argument
    • error

      public void error(String format, Object arg, Throwable throwable)
    • error

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

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

      参数:
      format - the format string
      arg1 - the first argument
      arg2 - the second argument
    • error

      public void error(String format, Object arg1, Object arg2, Throwable throwable)
    • error

      public 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. The variants taking one and two arguments exist solely in order to avoid this hidden cost.

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

      public 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
    • error

      public void error(Object message)
      Logs a message with error log level.
      参数:
      message - log this message
    • error

      public void error(Object message, Throwable t)
      Logs an error with error log level.
      参数:
      message - log this message
      t - log this cause
    • warn

      public void warn(Object message)
      Logs a message with warn log level.
      参数:
      message - log this message
    • warn

      public void warn(Object message, Throwable t)
      Logs an error with warn log level.
      参数:
      message - log this message
      t - log this cause
    • info

      public void info(Object message)
      Logs a message with info log level.
      参数:
      message - log this message
    • info

      public void info(Object message, Throwable t)
      Logs an error with info log level.
      参数:
      message - log this message
      t - log this cause
    • debug

      public void debug(Object message)
      Logs a message with debug log level.
      参数:
      message - log this message
    • debug

      public void debug(Object message, Throwable t)
      Logs an error with debug log level.
      参数:
      message - log this message
      t - log this cause
    • trace

      public void trace(Object message)
      Logs a message with trace log level.
      参数:
      message - log this message
    • trace

      public void trace(Object message, Throwable t)
      Logs an error with trace log level.
      参数:
      message - log this message
      t - log this cause
    • logInternal

      protected abstract void logInternal(Level level, String msg, Throwable t, Object[] args)
    • logInternal

      protected abstract void logInternal(Level level, Object msg, Throwable t)