Package fr.gouv.vitam.common.logging
Class AbstractVitamLogger
java.lang.Object
fr.gouv.vitam.common.logging.AbstractVitamLogger
- All Implemented Interfaces:
VitamLogger
,Serializable
This class implements all methods that have a
Inspired from Netty A skeletal implementation of
VitamLogLevel
parameter by default to call specific logger
methods such as VitamLogger.info(String)
or VitamLogger.isInfoEnabled()
. Inspired from Netty A skeletal implementation of
VitamLogger
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Log an exception (throwable) at the DEBUG level.void
Log an exception (throwable) at the ERROR level.void
Log an exception (throwable) at the INFO level.boolean
isEnabled
(VitamLogLevel level) Is the logger instance enabled for the specifiedlevel
?void
log
(VitamLogLevel level, String msg) Log a message at the specifiedlevel
.void
log
(VitamLogLevel level, String format, Object arg) Log a message at the specifiedlevel
according to the specified format and argument.void
log
(VitamLogLevel level, String format, Object... arguments) Log a message at the specifiedlevel
according to the specified format and arguments.void
log
(VitamLogLevel level, String format, Object argA, Object argB) Log a message at the specifiedlevel
according to the specified format and arguments.void
log
(VitamLogLevel level, String msg, Throwable cause) Log an exception (throwable) at the specifiedlevel
with an accompanying message.void
log
(VitamLogLevel level, Throwable cause) Log an exception (throwable) at the specifiedlevel
.name()
Return the name of thisVitamLogger
instance.protected Object
static final String
simpleClassName
(Class<?> clazz) static final String
toString()
void
Log an exception (throwable) at the TRACE level.void
Log an exception (throwable) at the WARN level.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface fr.gouv.vitam.common.logging.VitamLogger
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
-
Constructor Details
-
AbstractVitamLogger
Creates a new instance.
-
-
Method Details
-
name
Description copied from interface:VitamLogger
Return the name of thisVitamLogger
instance.- Specified by:
name
in interfaceVitamLogger
- Returns:
- name of this logger instance
-
isEnabled
Description copied from interface:VitamLogger
Is the logger instance enabled for the specifiedlevel
?- Specified by:
isEnabled
in interfaceVitamLogger
- Returns:
- True if this Logger is enabled for the specified
level
, false otherwise.
-
trace
Description copied from interface:VitamLogger
Log an exception (throwable) at the TRACE level.- Specified by:
trace
in interfaceVitamLogger
- Parameters:
t
- the exception (throwable) to log
-
debug
Description copied from interface:VitamLogger
Log an exception (throwable) at the DEBUG level.- Specified by:
debug
in interfaceVitamLogger
- Parameters:
t
- the exception (throwable) to log
-
info
Description copied from interface:VitamLogger
Log an exception (throwable) at the INFO level.- Specified by:
info
in interfaceVitamLogger
- Parameters:
t
- the exception (throwable) to log
-
warn
Description copied from interface:VitamLogger
Log an exception (throwable) at the WARN level.- Specified by:
warn
in interfaceVitamLogger
- Parameters:
t
- the exception (throwable) to log
-
error
Description copied from interface:VitamLogger
Log an exception (throwable) at the ERROR level.- Specified by:
error
in interfaceVitamLogger
- Parameters:
t
- the exception (throwable) to log
-
log
Description copied from interface:VitamLogger
Log an exception (throwable) at the specifiedlevel
with an accompanying message.- Specified by:
log
in interfaceVitamLogger
msg
- the message accompanying the exceptioncause
- the exception (throwable) to log
-
log
Description copied from interface:VitamLogger
Log an exception (throwable) at the specifiedlevel
.- Specified by:
log
in interfaceVitamLogger
cause
- the exception (throwable) to log
-
log
Description copied from interface:VitamLogger
Log a message at the specifiedlevel
.- Specified by:
log
in interfaceVitamLogger
msg
- the message string to be logged
-
log
Description copied from interface:VitamLogger
Log a message at the specifiedlevel
according to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the specified
level
.- Specified by:
log
in interfaceVitamLogger
format
- the format stringarg
- the argument
-
log
Description copied from interface:VitamLogger
Log a message at the specifiedlevel
according to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the specified
level
.- Specified by:
log
in interfaceVitamLogger
format
- the format stringargA
- the first argumentargB
- the second argument
-
log
Description copied from interface:VitamLogger
Log a message at the specifiedlevel
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 anObject[]
before invoking the method, even if this logger is disabled for the specifiedlevel
. The variants takingone
andtwo
arguments exist solely in order to avoid this hidden cost.- Specified by:
log
in interfaceVitamLogger
format
- the format stringarguments
- a list of 3 or more arguments
-
readResolve
- Throws:
ObjectStreamException
-
simpleClassName
- Parameters:
o
- the object to get its class name- Returns:
- the simple Class Name
-
simpleClassName
- Parameters:
clazz
- instance of a class- Returns:
- the simple Class Name
-
toString
-