public class Logger
extends java.lang.Object
Constructor and Description |
---|
Logger(java.lang.String thisLoggerID)
Create a new instance of Logger.
|
Logger(java.lang.String thisLoggerID,
java.lang.String thisClassName)
Create a new instance of Logger.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canDebug(java.lang.String messageLevel)
Return true if the logger can debug to the specified level.
|
protected boolean |
canLog(java.lang.String messageLevel)
Return true if the logger can log to the specified level.
|
void |
debugError(java.lang.String level,
java.lang.String message)
Debug the error on the appropriate channels.
|
void |
debugError(java.lang.String level,
java.lang.Throwable error)
Debug the error on the appropriate channels.
|
void |
debugMessage(java.lang.String level,
java.lang.String methodName,
java.lang.String message)
Debug the message on the appropriate channels.
|
boolean |
getDebug()
Get the value indicating if the debug channels are being used.
|
java.lang.String |
getLoggerID()
Get the unique id that created this logger.
|
boolean |
isDebugEnabled()
Return true if the logger is set to debug.
|
boolean |
isErrorEnabled()
Return true if the logger can log to the error level.
|
boolean |
isInfoEnabled()
Return true if the logger can log to the info level.
|
boolean |
isWarnEnabled()
Return true if the logger can log to the warn level.
|
void |
logError(java.lang.String level,
java.lang.String message,
java.lang.Throwable error)
Log the error on the appropriate channels.
|
void |
logError(java.lang.String level,
java.lang.Throwable error)
Log the error on the appropriate channels.
|
void |
logMessage(java.lang.String level,
java.lang.String message)
Log the message on the appropriate channels.
|
void |
logMessage(java.lang.String level,
java.lang.String methodName,
java.lang.String message)
Log the message on the appropriate channels.
|
void |
setDebug(boolean thisDebug)
Set a value indicating if the debug channels should be used.
|
public Logger(java.lang.String thisLoggerID)
thisLoggerID
- the unique logger id.public Logger(java.lang.String thisLoggerID, java.lang.String thisClassName)
thisLoggerID
- the unique logger id.thisClassName
- the class name of the class that uses this logger if
different from the logger id.public void setDebug(boolean thisDebug)
thisDebug
- true if log a debug trace, false otherwise.public boolean getDebug()
public java.lang.String getLoggerID()
public void logMessage(java.lang.String level, java.lang.String message)
level
- the log level for the message, error, warning, etc.message
- the message to log.public void logMessage(java.lang.String level, java.lang.String methodName, java.lang.String message)
level
- the log level for the message, error, warning, etc.methodName
- the name of the method in the class logging the message.message
- the message to log.public void debugMessage(java.lang.String level, java.lang.String methodName, java.lang.String message)
level
- the log level for the message, error, warning, etc.methodName
- the name of the method in the class logging the message.message
- the message to log.public void logError(java.lang.String level, java.lang.Throwable error)
level
- the log level for the message, error, warning, etc.error
- the error to log.public void logError(java.lang.String level, java.lang.String message, java.lang.Throwable error)
level
- the log level for the message, error, warning, etc.message
- an additional message.error
- the error to log.public void debugError(java.lang.String level, java.lang.Throwable error)
level
- the log level for the message, error, warning, etc.error
- the error to debug.public void debugError(java.lang.String level, java.lang.String message)
level
- the log level for the message, error, warning, etc.message
- the debug message to log.protected boolean canLog(java.lang.String messageLevel)
messageLevel
- the level to log to.protected boolean canDebug(java.lang.String messageLevel)
messageLevel
- the level to log to.public boolean isErrorEnabled()
public boolean isWarnEnabled()
public boolean isInfoEnabled()
public boolean isDebugEnabled()