public abstract class AbstractLogger extends Object implements ILogger, Serializable
ILogger. This class implements
all methods that have a LogLevel parameter by default to call
specific logger methods such as ILogger.info(String) or ILogger.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)
Is 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
ILogger instance. |
protected Object |
readResolve() |
static String |
simpleClassName(Class<?> clazz)
Generates a simplified name from a
Class. |
static String |
simpleClassName(Object o)
The shortcut to
simpleClassName(o.getClass()). |
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 static String simpleClassName(Object o)
simpleClassName(o.getClass()).public static String simpleClassName(Class<?> clazz)
Class. Similar to Class.getSimpleName(), but it works fine
with anonymous classes.public boolean isEnabled(LogLevel level)
ILoggerlevel?public void trace(Throwable t)
ILoggerpublic void debug(Throwable t)
ILoggerpublic void info(Throwable t)
ILoggerpublic void warn(Throwable t)
ILoggerpublic void error(Throwable t)
ILoggerpublic void log(LogLevel level, String msg, Throwable cause)
ILoggerlevel with an
accompanying message.public void log(LogLevel level, Throwable cause)
ILoggerlevel.public void log(LogLevel level, String msg)
ILoggerlevel.public void log(LogLevel level, String format, Object arg)
ILoggerlevel 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)
ILoggerlevel 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)
ILoggerlevel 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 © 2022. All rights reserved.