public abstract class AbstractVitamLogger extends Object implements VitamLogger, Serializable
VitamLogLevel
parameter by default to call specific logger
methods such as VitamLogger.info(String)
or VitamLogger.isInfoEnabled()
. VitamLogger
Modifier | Constructor and Description |
---|---|
protected |
AbstractVitamLogger(String name)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
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(VitamLogLevel level)
Is the logger instance enabled for the specified
level ? |
void |
log(VitamLogLevel level,
String msg)
Log a message at the specified
level . |
void |
log(VitamLogLevel level,
String format,
Object... arguments)
Log a message at the specified
level according to the specified format and arguments. |
void |
log(VitamLogLevel level,
String format,
Object arg)
Log a message at the specified
level according to the specified format and argument. |
void |
log(VitamLogLevel level,
String format,
Object argA,
Object argB)
Log a message at the specified
level according to the specified format and arguments. |
void |
log(VitamLogLevel level,
String msg,
Throwable cause)
Log an exception (throwable) at the specified
level with an accompanying message. |
void |
log(VitamLogLevel level,
Throwable cause)
Log an exception (throwable) at the specified
level . |
String |
name()
Return the name of this
VitamLogger instance. |
protected Object |
readResolve() |
static String |
simpleClassName(Class<?> clazz) |
static String |
simpleClassName(Object o) |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
debug, debug, debug, debug, debug, error, error, error, error, error, getLevel, info, info, info, info, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, setLevel, timeInfo, timeInfo, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn
protected AbstractVitamLogger(String name)
public String name()
VitamLogger
VitamLogger
instance.name
in interface VitamLogger
public boolean isEnabled(VitamLogLevel level)
VitamLogger
level
?isEnabled
in interface VitamLogger
level
, false otherwise.public void trace(Throwable t)
VitamLogger
trace
in interface VitamLogger
t
- the exception (throwable) to logpublic void debug(Throwable t)
VitamLogger
debug
in interface VitamLogger
t
- the exception (throwable) to logpublic void info(Throwable t)
VitamLogger
info
in interface VitamLogger
t
- the exception (throwable) to logpublic void warn(Throwable t)
VitamLogger
warn
in interface VitamLogger
t
- the exception (throwable) to logpublic void error(Throwable t)
VitamLogger
error
in interface VitamLogger
t
- the exception (throwable) to logpublic void log(VitamLogLevel level, String msg, Throwable cause)
VitamLogger
level
with an accompanying message.log
in interface VitamLogger
msg
- the message accompanying the exceptioncause
- the exception (throwable) to logpublic void log(VitamLogLevel level, Throwable cause)
VitamLogger
level
.log
in interface VitamLogger
cause
- the exception (throwable) to logpublic void log(VitamLogLevel level, String msg)
VitamLogger
level
.log
in interface VitamLogger
msg
- the message string to be loggedpublic void log(VitamLogLevel level, String format, Object arg)
VitamLogger
level
according to the specified format and argument.
This form avoids superfluous object creation when the logger is disabled for the specified level
.
log
in interface VitamLogger
format
- the format stringarg
- the argumentpublic void log(VitamLogLevel level, String format, Object argA, Object argB)
VitamLogger
level
according to the specified format and arguments.
This form avoids superfluous object creation when the logger is disabled for the specified level
.
log
in interface VitamLogger
format
- the format stringargA
- the first argumentargB
- the second argumentpublic void log(VitamLogLevel level, String format, Object... arguments)
VitamLogger
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
in interface VitamLogger
format
- the format stringarguments
- a list of 3 or more argumentsprotected Object readResolve() throws ObjectStreamException
ObjectStreamException
public static final String simpleClassName(Object o)
o
- the object to get its class namepublic static final String simpleClassName(Class<?> clazz)
clazz
- instance of a classCopyright © 2018 Vitam. All rights reserved.