@ThreadSafe public abstract class Logger extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Logger.Level |
Constructor and Description |
---|
Logger() |
Modifier and Type | Method and Description |
---|---|
abstract void |
debug(String message,
Object... params)
Log a message at the DEBUG level according to the specified format and (optional) parameters.
|
abstract void |
debug(Throwable t,
String message,
Object... params)
Log an exception (throwable) at the DEBUG level with an accompanying message.
|
abstract void |
error(I18nResource message,
Object... params)
Log a message at the ERROR level according to the specified format and (optional) parameters.
|
abstract void |
error(Throwable t,
I18nResource message,
Object... params)
Log an exception (throwable) at the ERROR level with an accompanying message.
|
static Logger |
getLogger(Class<?> clazz)
Return a logger named corresponding to the class passed as parameter.
|
static Logger |
getLogger(String name)
Return a logger named according to the name parameter.
|
static Locale |
getLoggingLocale()
Get the locale used for the logs.
|
abstract String |
getName()
Return the name of this logger instance.
|
abstract void |
info(I18nResource message,
Object... params)
Log a message at the INFO level according to the specified format and (optional) parameters.
|
abstract void |
info(Throwable t,
I18nResource message,
Object... params)
Log an exception (throwable) at the INFO level with an accompanying message.
|
abstract boolean |
isDebugEnabled()
Return whether messages at the DEBUG level are being logged.
|
abstract boolean |
isErrorEnabled()
Return whether messages at the ERROR level are being logged.
|
abstract boolean |
isInfoEnabled()
Return whether messages at the INFORMATION level are being logged.
|
abstract boolean |
isTraceEnabled()
Return whether messages at the TRACE level are being logged.
|
abstract boolean |
isWarnEnabled()
Return whether messages at the WARNING level are being logged.
|
void |
log(Logger.Level level,
I18nResource message,
Object... params)
Log a message at the supplied level according to the specified format and (optional) parameters.
|
void |
log(Logger.Level level,
Throwable t,
I18nResource message,
Object... params)
Log an exception (throwable) at the supplied level with an accompanying message.
|
static Locale |
setLoggingLocale(Locale locale)
Set the locale used for the logs.
|
abstract void |
trace(String message,
Object... params)
Log a message at the TRACE level according to the specified format and (optional) parameters.
|
abstract void |
trace(Throwable t,
String message,
Object... params)
Log an exception (throwable) at the TRACE level with an accompanying message.
|
abstract void |
warn(I18nResource message,
Object... params)
Log a message at the WARNING level according to the specified format and (optional) parameters.
|
abstract void |
warn(Throwable t,
I18nResource message,
Object... params)
Log an exception (throwable) at the WARNING level with an accompanying message.
|
public static Locale getLoggingLocale()
default locale
is used.setLoggingLocale(Locale)
public static Locale setLoggingLocale(Locale locale)
default locale
. To use the default locale, call this method with a null value.locale
- the desired locale to use for the logs, or null if the system locale should be usedgetLoggingLocale()
public static Logger getLogger(Class<?> clazz)
clazz
- the returned logger will be named after clazzpublic static Logger getLogger(String name)
name
- The name of the logger.public abstract String getName()
public void log(Logger.Level level, I18nResource message, Object... params)
level
- the level at which to logmessage
- the (localized) message stringparams
- the parameter values that are to replace the variables in the format stringpublic void log(Logger.Level level, Throwable t, I18nResource message, Object... params)
debug(String, Object...)
.level
- the level at which to logt
- the exception (throwable) to logmessage
- the message accompanying the exceptionparams
- the parameter values that are to replace the variables in the format stringpublic abstract void debug(String message, Object... params)
message
- the message stringparams
- the parameter values that are to replace the variables in the format stringpublic abstract void debug(Throwable t, String message, Object... params)
debug(String, Object...)
.t
- the exception (throwable) to logmessage
- the message accompanying the exceptionparams
- the parameter values that are to replace the variables in the format stringpublic abstract void error(I18nResource message, Object... params)
message
- the message stringparams
- the parameter values that are to replace the variables in the format stringpublic abstract void error(Throwable t, I18nResource message, Object... params)
error(org.modeshape.common.i18n.I18nResource, Object...)
.t
- the exception (throwable) to logmessage
- the message accompanying the exceptionparams
- the parameter values that are to replace the variables in the format stringpublic abstract void info(I18nResource message, Object... params)
message
- the message stringparams
- the parameter values that are to replace the variables in the format stringpublic abstract void info(Throwable t, I18nResource message, Object... params)
info(org.modeshape.common.i18n.I18nResource, Object...)
.t
- the exception (throwable) to logmessage
- the message accompanying the exceptionparams
- the parameter values that are to replace the variables in the format stringpublic abstract void trace(String message, Object... params)
message
- the message stringparams
- the parameter values that are to replace the variables in the format stringpublic abstract void trace(Throwable t, String message, Object... params)
trace(String, Object...)
.t
- the exception (throwable) to logmessage
- the message accompanying the exceptionparams
- the parameter values that are to replace the variables in the format stringpublic abstract void warn(I18nResource message, Object... params)
message
- the message stringparams
- the parameter values that are to replace the variables in the format stringpublic abstract void warn(Throwable t, I18nResource message, Object... params)
warn(org.modeshape.common.i18n.I18nResource, Object...)
.t
- the exception (throwable) to logmessage
- the message accompanying the exceptionparams
- the parameter values that are to replace the variables in the format stringpublic abstract boolean isInfoEnabled()
public abstract boolean isWarnEnabled()
public abstract boolean isErrorEnabled()
public abstract boolean isDebugEnabled()
public abstract boolean isTraceEnabled()
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.