public abstract class AbstractLogger extends Object implements Logger, Serializable
Logger. This class implements
all methods that have a LogLevel parameter by default to call
specific logger methods such as Logger.info(String) or Logger.isInfoEnabled().| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractLogger(String name)
Creates a new instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
debug(Throwable t)
Log an exception (throwable) at the DEBUG level.
|
void |
error(Throwable t)
Log an exception (throwable) at the ERROR level.
|
void |
info(Throwable t)
Log an exception (throwable) at the INFO level.
|
boolean |
isEnabled(LogLevel level)
Whether the logger instance enabled for the specified
level. |
void |
log(LogLevel level,
String msg)
Log a message at the specified
level. |
void |
log(LogLevel level,
String format,
Object... arguments)
Log a message at the specified
level according to the specified format
and arguments. |
void |
log(LogLevel level,
String format,
Object arg)
Log a message at the specified
level according to the specified format
and argument. |
void |
log(LogLevel level,
String format,
Object argA,
Object argB)
Log a message at the specified
level according to the specified format
and arguments. |
void |
log(LogLevel level,
String msg,
Throwable cause)
Log an exception (throwable) at the specified
level with an
accompanying message. |
void |
log(LogLevel level,
Throwable cause)
Log an exception (throwable) at the specified
level. |
String |
name()
Return the name of this
Logger instance. |
protected Object |
readResolve() |
String |
toString() |
void |
trace(Throwable t)
Log an exception (throwable) at the TRACE level.
|
void |
warn(Throwable t)
Log an exception (throwable) at the WARN level.
|
protected AbstractLogger(String name)
public boolean isEnabled(LogLevel level)
Loggerlevel.public void trace(Throwable t)
Loggerpublic void debug(Throwable t)
Loggerpublic void error(Throwable t)
Loggerpublic void log(LogLevel level, String msg, Throwable cause)
Loggerlevel with an
accompanying message.public void log(LogLevel level, Throwable cause)
Loggerlevel.public void log(LogLevel level, String msg)
Loggerlevel.public void log(LogLevel level, String format, Object arg)
Loggerlevel according to the specified format
and argument.
This form avoids superfluous object creation when the logger
is disabled for the specified level.
public void log(LogLevel level, String format, Object argA, Object argB)
Loggerlevel according to the specified format
and arguments.
This form avoids superfluous object creation when the logger
is disabled for the specified level.
public void log(LogLevel level, String format, Object... arguments)
Loggerlevel according to the specified format
and arguments.
This form avoids superfluous string concatenation when the logger
is disabled for the specified 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 specified level. The variants taking
one and
two arguments exist solely
in order to avoid this hidden cost.
protected Object readResolve() throws ObjectStreamException
Copyright © 2021. All rights reserved.