public class WrappingLogger
extends java.util.logging.Logger
Logging is only forwarded to the wrapped logger in case this
logs for the level of the current record.
Otherwise logging is done by this logger.
| Modifier and Type | Field and Description |
|---|---|
protected java.util.logging.Logger |
innerLogger
The wrapped logger.
|
| Modifier | Constructor and Description |
|---|---|
protected |
WrappingLogger(java.util.logging.Logger innerLogger)
Creates a new logger wrapping the designated one.
|
protected |
WrappingLogger(java.lang.String name,
java.util.logging.Logger innerLogger)
Creates a new logger wrapping the designated one and having the designated
name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(java.util.logging.Handler handler) |
boolean |
equals(java.lang.Object obj)
Calls
equals(Object) of the inner logger. |
java.util.logging.Filter |
getFilter() |
java.util.logging.Handler[] |
getHandlers() |
java.util.logging.Level |
getLevel() |
java.lang.String |
getName() |
java.util.logging.Logger |
getParent() |
java.util.ResourceBundle |
getResourceBundle() |
java.lang.String |
getResourceBundleName() |
boolean |
getUseParentHandlers() |
int |
hashCode() |
boolean |
isLoggable(java.util.logging.Level level)
Since this method delegates to the inner logger, it usually has to be
overridden in case (a subclass of) this logger sets the level without
propagating it to the wrapped logger.
|
void |
log(java.util.logging.LogRecord record)
Logs the designated record by the wrapped logger in case the wrapped logger
logs the corresponding level.
|
void |
removeHandler(java.util.logging.Handler handler) |
void |
setFilter(java.util.logging.Filter newFilter) |
void |
setLevel(java.util.logging.Level newLevel) |
protected void |
setLevel(java.util.logging.Level newLevel,
boolean propagate)
Sets the level of this logger to the designated one.
|
void |
setParent(java.util.logging.Logger parent) |
void |
setUseParentHandlers(boolean useParentHandlers) |
config, config, entering, entering, entering, exiting, exiting, fine, fine, finer, finer, finest, finest, getAnonymousLogger, getAnonymousLogger, getGlobal, getLogger, getLogger, info, info, log, log, log, log, log, log, logp, logp, logp, logp, logp, logp, logrb, logrb, logrb, logrb, logrb, logrb, setResourceBundle, severe, severe, throwing, warning, warningprotected WrappingLogger(java.util.logging.Logger innerLogger)
innerLogger - The logger to which all requests will be forwarded.protected WrappingLogger(java.lang.String name,
java.util.logging.Logger innerLogger)
innerLogger - The logger to which all requests will be forwarded.name - The name of the logger (this). This name is used in log
records.public java.util.ResourceBundle getResourceBundle()
getResourceBundle in class java.util.logging.Loggerpublic java.lang.String getResourceBundleName()
getResourceBundleName in class java.util.logging.Loggerpublic void setFilter(java.util.logging.Filter newFilter)
throws java.lang.SecurityException
setFilter in class java.util.logging.Loggerjava.lang.SecurityExceptionpublic java.util.logging.Filter getFilter()
getFilter in class java.util.logging.Loggerpublic void setLevel(java.util.logging.Level newLevel)
throws java.lang.SecurityException
setLevel in class java.util.logging.Loggerjava.lang.SecurityExceptionprotected void setLevel(java.util.logging.Level newLevel,
boolean propagate)
newLevel - The level to set in this logger.propagate - Whether the designated level should be propagated to the
wrapped logger.public java.util.logging.Level getLevel()
getLevel in class java.util.logging.Loggerpublic boolean isLoggable(java.util.logging.Level level)
isLoggable in class java.util.logging.Loggerpublic java.lang.String getName()
getName in class java.util.logging.Loggerpublic void addHandler(java.util.logging.Handler handler)
throws java.lang.SecurityException
addHandler in class java.util.logging.Loggerjava.lang.SecurityExceptionpublic void removeHandler(java.util.logging.Handler handler)
throws java.lang.SecurityException
removeHandler in class java.util.logging.Loggerjava.lang.SecurityExceptionpublic java.util.logging.Handler[] getHandlers()
getHandlers in class java.util.logging.Loggerpublic void setUseParentHandlers(boolean useParentHandlers)
setUseParentHandlers in class java.util.logging.Loggerpublic boolean getUseParentHandlers()
getUseParentHandlers in class java.util.logging.Loggerpublic java.util.logging.Logger getParent()
getParent in class java.util.logging.Loggerpublic void setParent(java.util.logging.Logger parent)
setParent in class java.util.logging.Loggerpublic void log(java.util.logging.LogRecord record)
log in class java.util.logging.Loggerpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals(Object) of the inner logger. However, the designated
object will be unwrapped if it is also a WrappingLogger.equals in class java.lang.Object