Class Logger
This class implements a thin wrapper around a subset of methods of
the Logger
class from the SLF4J facade, in order to allow
those methods commonly used by the toolkit to be usable without invoking
a runtime dependency on the SLF4J jar files.
For how to configure the logger properties, see the package description.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected SimpleDateFormat
protected boolean
protected boolean
protected boolean
protected static long
protected static boolean
protected boolean
protected org.slf4j.Logger
protected boolean
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Log a message at the DEBUG level.void
Log a message at the DEBUG level.void
Log an exception (throwable) at the DEBUG level with an accompanying message.void
Log a message at the ERROR level.void
Log a message at the ERROR level.void
Log an exception (throwable) at the ERROR level with an accompanying message.protected static String
getFormattedStringFromArguments
(String format, Object... arguments) protected String
getPreamable
(String level) void
Log a message at the INFO level.void
Log a message at the INFO level.void
Log an exception (throwable) at the INFO level with an accompanying message.boolean
Is the logger instance enabled for the DEBUG level?boolean
Is the logger instance enabled for the ERROR level?boolean
Is the logger instance enabled for the INFO level?boolean
Is the logger instance enabled for the TRACE level?boolean
Is the logger instance enabled for the WARN level?protected void
setLoggingDetailLevel
(String level) void
Log a message at the TRACE level.void
Log a message at the TRACE level.void
Log an exception (throwable) at the TRACE level with an accompanying message.void
Log a message at the WARN level.void
Log a message at the WARN level.void
Log an exception (throwable) at the WARN level with an accompanying message.
-
Field Details
-
slf4jlogger
protected org.slf4j.Logger slf4jlogger -
className
-
errorEnabled
protected boolean errorEnabled -
warnEnabled
protected boolean warnEnabled -
infoEnabled
protected boolean infoEnabled -
debugEnabled
protected boolean debugEnabled -
traceEnabled
protected boolean traceEnabled -
showDateTime
protected boolean showDateTime -
dateFormatter
-
millisecondsSinceEpochAtStartIsSet
protected static boolean millisecondsSinceEpochAtStartIsSet -
millisecondsSinceEpochAtStart
protected static long millisecondsSinceEpochAtStart
-
-
Constructor Details
-
Logger
protected Logger(org.slf4j.Logger slf4jlogger) Construct a logger that uses an slf4j Logger.
- Parameters:
slf4jlogger
- an slf4jlogger
-
Logger
Construct a default logger named corresponding to the class name passed as parameter.
- Parameters:
className
- the name of the logger
-
-
Method Details
-
isErrorEnabled
public boolean isErrorEnabled()Is the logger instance enabled for the ERROR level?
return True if this Logger is enabled for the ERROR level, false otherwise. -
isWarnEnabled
public boolean isWarnEnabled()Is the logger instance enabled for the WARN level?
return True if this Logger is enabled for the WARN level, false otherwise. -
isInfoEnabled
public boolean isInfoEnabled()Is the logger instance enabled for the INFO level?
return True if this Logger is enabled for the INFO level, false otherwise. -
isDebugEnabled
public boolean isDebugEnabled()Is the logger instance enabled for the DEBUG level?
return True if this Logger is enabled for the DEBUG level, false otherwise. -
isTraceEnabled
public boolean isTraceEnabled()Is the logger instance enabled for the TRACE level?
return True if this Logger is enabled for the TRACE level, false otherwise. -
setLoggingDetailLevel
-
error
Log a message at the ERROR level.
- Parameters:
msg
- the message string to be logged
-
error
Log a message at the ERROR level.
- Parameters:
format
- the format stringarguments
- a list of 1 or more arguments
-
error
Log an exception (throwable) at the ERROR level with an accompanying message.
- Parameters:
msg
- the message accompanying the exceptiont
- the exception (throwable) to log
-
warn
Log a message at the WARN level.
- Parameters:
msg
- the message string to be logged
-
warn
Log a message at the WARN level.
- Parameters:
format
- the format stringarguments
- a list of 1 or more arguments
-
warn
Log an exception (throwable) at the WARN level with an accompanying message.
- Parameters:
msg
- the message accompanying the exceptiont
- the exception (throwable) to log
-
info
Log a message at the INFO level.
- Parameters:
msg
- the message string to be logged
-
info
Log a message at the INFO level.
- Parameters:
format
- the format stringarguments
- a list of 1 or more arguments
-
info
Log an exception (throwable) at the INFO level with an accompanying message.
- Parameters:
msg
- the message accompanying the exceptiont
- the exception (throwable) to log
-
debug
Log a message at the DEBUG level.
- Parameters:
msg
- the message string to be logged
-
debug
Log a message at the DEBUG level.
- Parameters:
format
- the format stringarguments
- a list of 1 or more arguments
-
debug
Log an exception (throwable) at the DEBUG level with an accompanying message.
- Parameters:
msg
- the message accompanying the exceptiont
- the exception (throwable) to log
-
trace
Log a message at the TRACE level.
- Parameters:
msg
- the message string to be logged
-
trace
Log a message at the TRACE level.
- Parameters:
format
- the format stringarguments
- a list of 1 or more arguments
-
trace
Log an exception (throwable) at the TRACE level with an accompanying message.
- Parameters:
msg
- the message accompanying the exceptiont
- the exception (throwable) to log
-
getPreamable
-
getFormattedStringFromArguments
-