Class Logger
- java.lang.Object
-
- com.pixelmed.slf4j.Logger
-
public class Logger extends java.lang.ObjectThis class implements a thin wrapper around a subset of methods of the
Loggerclass 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:
LoggerFactory
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringclassNameprotected java.text.SimpleDateFormatdateFormatterprotected booleandebugEnabledprotected booleanerrorEnabledprotected booleaninfoEnabledprotected static longmillisecondsSinceEpochAtStartprotected static booleanmillisecondsSinceEpochAtStartIsSetprotected booleanshowDateTimeprotected org.slf4j.Loggerslf4jloggerprotected booleantraceEnabledprotected booleanwarnEnabled
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(java.lang.String msg)Log a message at the DEBUG level.voiddebug(java.lang.String format, java.lang.Object... arguments)Log a message at the DEBUG level.voiddebug(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the DEBUG level with an accompanying message.voiderror(java.lang.String msg)Log a message at the ERROR level.voiderror(java.lang.String format, java.lang.Object... arguments)Log a message at the ERROR level.voiderror(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the ERROR level with an accompanying message.protected static java.lang.StringgetFormattedStringFromArguments(java.lang.String format, java.lang.Object... arguments)protected java.lang.StringgetPreamable(java.lang.String level)voidinfo(java.lang.String msg)Log a message at the INFO level.voidinfo(java.lang.String format, java.lang.Object... arguments)Log a message at the INFO level.voidinfo(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the INFO level with an accompanying message.booleanisDebugEnabled()Is the logger instance enabled for the DEBUG level?booleanisErrorEnabled()Is the logger instance enabled for the ERROR level?booleanisInfoEnabled()Is the logger instance enabled for the INFO level?booleanisTraceEnabled()Is the logger instance enabled for the TRACE level?booleanisWarnEnabled()Is the logger instance enabled for the WARN level?protected voidsetLoggingDetailLevel(java.lang.String level)voidtrace(java.lang.String msg)Log a message at the TRACE level.voidtrace(java.lang.String format, java.lang.Object... arguments)Log a message at the TRACE level.voidtrace(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the TRACE level with an accompanying message.voidwarn(java.lang.String msg)Log a message at the WARN level.voidwarn(java.lang.String format, java.lang.Object... arguments)Log a message at the WARN level.voidwarn(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the WARN level with an accompanying message.
-
-
-
Field Detail
-
slf4jlogger
protected org.slf4j.Logger slf4jlogger
-
className
protected java.lang.String 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
protected java.text.SimpleDateFormat dateFormatter
-
millisecondsSinceEpochAtStartIsSet
protected static boolean millisecondsSinceEpochAtStartIsSet
-
millisecondsSinceEpochAtStart
protected static long millisecondsSinceEpochAtStart
-
-
Constructor Detail
-
Logger
protected Logger(org.slf4j.Logger slf4jlogger)
Construct a logger that uses an slf4j Logger.
- Parameters:
slf4jlogger- an slf4jlogger
-
Logger
protected Logger(java.lang.String className)
Construct a default logger named corresponding to the class name passed as parameter.
- Parameters:
className- the name of the logger
-
-
Method Detail
-
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
protected void setLoggingDetailLevel(java.lang.String level)
-
error
public void error(java.lang.String msg)
Log a message at the ERROR level.
- Parameters:
msg- the message string to be logged
-
error
public void error(java.lang.String format, java.lang.Object... arguments)Log a message at the ERROR level.
- Parameters:
format- the format stringarguments- a list of 1 or more arguments
-
error
public void error(java.lang.String msg, java.lang.Throwable t)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
public void warn(java.lang.String msg)
Log a message at the WARN level.
- Parameters:
msg- the message string to be logged
-
warn
public void warn(java.lang.String format, java.lang.Object... arguments)Log a message at the WARN level.
- Parameters:
format- the format stringarguments- a list of 1 or more arguments
-
warn
public void warn(java.lang.String msg, java.lang.Throwable t)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
public void info(java.lang.String msg)
Log a message at the INFO level.
- Parameters:
msg- the message string to be logged
-
info
public void info(java.lang.String format, java.lang.Object... arguments)Log a message at the INFO level.
- Parameters:
format- the format stringarguments- a list of 1 or more arguments
-
info
public void info(java.lang.String msg, java.lang.Throwable t)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
public void debug(java.lang.String msg)
Log a message at the DEBUG level.
- Parameters:
msg- the message string to be logged
-
debug
public void debug(java.lang.String format, java.lang.Object... arguments)Log a message at the DEBUG level.
- Parameters:
format- the format stringarguments- a list of 1 or more arguments
-
debug
public void debug(java.lang.String msg, java.lang.Throwable t)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
public void trace(java.lang.String msg)
Log a message at the TRACE level.
- Parameters:
msg- the message string to be logged
-
trace
public void trace(java.lang.String format, java.lang.Object... arguments)Log a message at the TRACE level.
- Parameters:
format- the format stringarguments- a list of 1 or more arguments
-
trace
public void trace(java.lang.String msg, java.lang.Throwable t)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
protected java.lang.String getPreamable(java.lang.String level)
-
getFormattedStringFromArguments
protected static java.lang.String getFormattedStringFromArguments(java.lang.String format, java.lang.Object... arguments)
-
-