public abstract class AbstractInternalLogger extends java.lang.Object implements InternalLogger, java.io.Serializable
InternalLogger
. This class implements
all methods that have a InternalLogLevel
parameter by default to call
specific logger methods such as InternalLogger.info(String)
or InternalLogger.isInfoEnabled()
.限定符 | 构造器和说明 |
---|---|
protected |
AbstractInternalLogger(java.lang.String name)
Creates a new instance.
|
限定符和类型 | 方法和说明 |
---|---|
boolean |
isEnabled(InternalLogLevel level)
Is the logger instance enabled for the specified
level ? |
void |
log(InternalLogLevel level,
java.lang.String msg)
Log a message at the specified
level . |
void |
log(InternalLogLevel level,
java.lang.String format,
java.lang.Object... arguments)
Log a message at the specified
level according to the specified format
and arguments. |
void |
log(InternalLogLevel level,
java.lang.String format,
java.lang.Object arg)
Log a message at the specified
level according to the specified format
and argument. |
void |
log(InternalLogLevel level,
java.lang.String format,
java.lang.Object argA,
java.lang.Object argB)
Log a message at the specified
level according to the specified format
and arguments. |
void |
log(InternalLogLevel level,
java.lang.String msg,
java.lang.Throwable cause)
Log an exception (throwable) at the specified
level with an
accompanying message. |
java.lang.String |
name()
Return the name of this
InternalLogger instance. |
protected java.lang.Object |
readResolve() |
java.lang.String |
toString() |
protected AbstractInternalLogger(java.lang.String name)
public java.lang.String name()
InternalLogger
InternalLogger
instance.name
在接口中 InternalLogger
public boolean isEnabled(InternalLogLevel level)
InternalLogger
level
?isEnabled
在接口中 InternalLogger
level
,
false otherwise.public void log(InternalLogLevel level, java.lang.String msg, java.lang.Throwable cause)
InternalLogger
level
with an
accompanying message.log
在接口中 InternalLogger
msg
- the message accompanying the exceptioncause
- the exception (throwable) to logpublic void log(InternalLogLevel level, java.lang.String msg)
InternalLogger
level
.log
在接口中 InternalLogger
msg
- the message string to be loggedpublic void log(InternalLogLevel level, java.lang.String format, java.lang.Object arg)
InternalLogger
level
according to the specified format
and argument.
This form avoids superfluous object creation when the logger
is disabled for the specified level
.
log
在接口中 InternalLogger
format
- the format stringarg
- the argumentpublic void log(InternalLogLevel level, java.lang.String format, java.lang.Object argA, java.lang.Object argB)
InternalLogger
level
according to the specified format
and arguments.
This form avoids superfluous object creation when the logger
is disabled for the specified level
.
log
在接口中 InternalLogger
format
- the format stringargA
- the first argumentargB
- the second argumentpublic void log(InternalLogLevel level, java.lang.String format, java.lang.Object... arguments)
InternalLogger
level
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.
log
在接口中 InternalLogger
format
- the format stringarguments
- a list of 3 or more argumentsprotected java.lang.Object readResolve() throws java.io.ObjectStreamException
java.io.ObjectStreamException
public java.lang.String toString()
toString
在类中 java.lang.Object