ANONYMOUS_LOGGER_NAME, LL_DEBUG, LL_ERROR, LL_INFO, LL_NONE, LL_WARNING
Constructor and Description |
---|
Logger2Logger(Logger logger) |
Modifier and Type | Method and Description |
---|---|
void |
debugf(java.lang.String msgTemplate,
java.lang.Object... params)
Writes the given message template to the log if log level DEBUG
is activated for this logger.
|
void |
debugf(java.lang.Throwable t,
java.lang.String msgTemplate,
java.lang.Object... params)
Writes the given message template to the log if log level DEBUG
is activated for this logger.
|
void |
errorf(java.lang.String msgTemplate,
java.lang.Object... params)
Writes the given message template to the log if log level ERROR
is activated for this logger.
|
void |
errorf(java.lang.Throwable t,
java.lang.String msgTemplate,
java.lang.Object... params)
Writes the given message template to the log if log level ERROR
is activated for this logger.
|
protected Logger |
getDelegateLogger() |
java.lang.String |
getLoggerName()
Returns the name of this logger.
|
LogLevel |
getLogLevel()
Returns the log level of this logger.
|
protected java.lang.String |
getLogMessage(java.lang.String template,
java.lang.Object... params) |
java.lang.String |
getName()
Returns the name of this logger.
|
void |
infof(java.lang.String msgTemplate,
java.lang.Object... params)
Writes the given message template to the log if log level INFO
is activated for this logger.
|
void |
infof(java.lang.Throwable t,
java.lang.String msgTemplate,
java.lang.Object... params)
Writes the given message template to the log if log level INFO
is activated for this logger.
|
void |
initialize(java.util.Properties properties)
Initialize the logger from the given properties settings.
|
boolean |
isDebugEnabled()
Returns true if this logger's log level allows debug logging.
|
boolean |
isEnabled(LogLevel level)
Returns true if this logger's log level allows logging on the given level.
|
boolean |
isErrorEnabled()
Returns true if this logger's log level allows error logging.
|
boolean |
isInfoEnabled()
Returns true if this logger's log level allows info logging.
|
boolean |
isLoggingDebugs()
Returns true, if debug messages will be written to the output device(s).
|
boolean |
isLoggingErrors()
Returns true, if errors will be written to the output device(s).
|
boolean |
isLoggingInfos()
Returns true, if info messages will be written to the output device(s).
|
boolean |
isLoggingWarnings()
Returns true, if warnings will be written to the output device(s).
|
boolean |
isWarnEnabled()
Returns true if this logger's log level allows warn logging.
|
void |
logDebug(java.lang.String message,
java.lang.Object... params)
If the logging level is DEBUG the given message will be written to
the log output device(s).
|
void |
logError(java.lang.String message,
java.lang.Object... params)
If the logging level is DEBUG, INFO, WARNING or ERROR the given message
will be written to the log output device(s).
|
void |
logError(java.lang.String message,
java.lang.Throwable exception)
If the logging level is DEBUG, INFO, WARNING or ERROR the given message
and the exception will be written to the log output device(s).
|
void |
logException(java.lang.Throwable ex)
Writes the given exception to the log output device(s).
|
void |
logf(LogLevel level,
java.lang.String msgTemplate,
java.lang.Object... params)
Writes the given message template to the log if the specified log level
is activated for this logger.
|
void |
logf(LogLevel level,
java.lang.Throwable t,
java.lang.String msgTemplate,
java.lang.Object... params)
Writes the given message template to the log if the specified log level
is activated for this logger.
|
void |
logInfo(java.lang.String message,
java.lang.Object... params)
If the logging level is INFO or DEBUG the given message will be
written to the log output device(s).
|
void |
logWarning(java.lang.String message,
java.lang.Object... params)
If the logging level is DEBUG, INFO or WARNING the given message will
be written to the log output device(s).
|
void |
logWarning(java.lang.String message,
java.lang.Throwable exception)
If the logging level is DEBUG, INFO or WARNING the given message
and the exception will be written to the log output device(s).
|
void |
setLogLevel(LogLevel level)
Sets the log level of this logger.
|
boolean |
setLogLevel(java.lang.String level)
Changes the log level to the specified level.
|
void |
warnf(java.lang.String msgTemplate,
java.lang.Object... params)
Writes the given message template to the log if log level WARNING
is activated for this logger.
|
void |
warnf(java.lang.Throwable t,
java.lang.String msgTemplate,
java.lang.Object... params)
Writes the given message template to the log if log level WARNING
is activated for this logger.
|
public Logger2Logger(Logger logger)
public java.lang.String getName()
Logger
public void initialize(java.util.Properties properties)
Logger
initialize
in interface Logger
public boolean isLoggingDebugs()
Logger
isLoggingDebugs
in interface Logger
public boolean isLoggingInfos()
Logger
isLoggingInfos
in interface Logger
public boolean isLoggingWarnings()
Logger
isLoggingWarnings
in interface Logger
public boolean isLoggingErrors()
Logger
isLoggingErrors
in interface Logger
public void logDebug(java.lang.String message, java.lang.Object... params)
Logger
public void logInfo(java.lang.String message, java.lang.Object... params)
Logger
public void logWarning(java.lang.String message, java.lang.Object... params)
Logger
logWarning
in interface Logger
message
- The message to log. It may contain placeholders like {0}, {1} etc.params
- Optional parameters to be used for replacing placeholders in the message text.public void logWarning(java.lang.String message, java.lang.Throwable exception)
Logger
logWarning
in interface Logger
public void logError(java.lang.String message, java.lang.Object... params)
Logger
public void logError(java.lang.String message, java.lang.Throwable exception)
Logger
public void logException(java.lang.Throwable ex)
Logger
logException
in interface Logger
public boolean setLogLevel(java.lang.String level)
Logger
setLogLevel
in interface Logger
level
- One of the LL_ constants defined in this interface (e.g. Logger.LL_ERROR
).public java.lang.String getLoggerName()
Logger2
getLoggerName
in interface Logger2
public LogLevel getLogLevel()
Logger2
getLogLevel
in interface Logger2
public void setLogLevel(LogLevel level)
Logger2
setLogLevel
in interface Logger2
public boolean isEnabled(LogLevel level)
public boolean isDebugEnabled()
isDebugEnabled
in interface Logger2
public boolean isInfoEnabled()
isInfoEnabled
in interface Logger2
public boolean isWarnEnabled()
isWarnEnabled
in interface Logger2
public boolean isErrorEnabled()
isErrorEnabled
in interface Logger2
public void debugf(java.lang.String msgTemplate, java.lang.Object... params)
public void debugf(java.lang.Throwable t, java.lang.String msgTemplate, java.lang.Object... params)
The provided throwable will also be sent to the log after the message. It probably (depending on configuration) will be written as stacktrace.
public void infof(java.lang.String msgTemplate, java.lang.Object... params)
public void infof(java.lang.Throwable t, java.lang.String msgTemplate, java.lang.Object... params)
The provided throwable will also be sent to the log after the message. It probably (depending on configuration) will be written as stacktrace.
public void warnf(java.lang.String msgTemplate, java.lang.Object... params)
public void warnf(java.lang.Throwable t, java.lang.String msgTemplate, java.lang.Object... params)
The provided throwable will also be sent to the log after the message. It probably (depending on configuration) will be written as stacktrace.
public void errorf(java.lang.String msgTemplate, java.lang.Object... params)
public void errorf(java.lang.Throwable t, java.lang.String msgTemplate, java.lang.Object... params)
The provided throwable will also be sent to the log after the message. It probably (depending on configuration) will be written as stacktrace.
public void logf(LogLevel level, java.lang.String msgTemplate, java.lang.Object... params)
public void logf(LogLevel level, java.lang.Throwable t, java.lang.String msgTemplate, java.lang.Object... params)
The provided throwable will also be sent to the log after the message. It probably (depending on configuration) will be written as stacktrace.
protected java.lang.String getLogMessage(java.lang.String template, java.lang.Object... params)
protected Logger getDelegateLogger()