|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.util.logging.LoggerFactory<L>
public abstract class LoggerFactory<L>
A factory for Java Logger
wrapping an other logging framework. This factory is used
only when wanting to log to an other framework than Java logging. The getLogger(java.lang.String)
method returns some subclass of Logger
(typicallly LoggerAdapter
) that
forward directly all log methods to an other framework.
Logging
,
LoggerAdapter
Constructor Summary | |
---|---|
protected |
LoggerFactory(java.lang.Class<L> loggerClass)
Creates a new factory. |
Method Summary | |
---|---|
protected abstract L |
getImplementation(java.lang.String name)
Returns the implementation to use for the logger of the specified name. |
java.lang.Class<L> |
getImplementationClass()
Returns the base class of objects to be returned by getImplementation(java.lang.String) . |
java.util.logging.Logger |
getLogger(java.lang.String name)
Returns the logger of the specified name, or null . |
protected abstract L |
unwrap(java.util.logging.Logger logger)
Returns the implementation wrapped by the specified logger, or null if none. |
protected abstract java.util.logging.Logger |
wrap(java.lang.String name,
L implementation)
Wraps the specified implementation in a Java logger. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LoggerFactory(java.lang.Class<L> loggerClass)
loggerClass
- The class of the wrapped logger.Method Detail |
---|
public java.util.logging.Logger getLogger(java.lang.String name)
null
. If this method has already been
invoked previously with the same name
argument, then it may returns the same logger
provided that:
getImplementation(name)
has
not changed.Logger
instance, or null
if the
standard Java logging framework should be used.
name
- The name of the logger.
null
.public java.lang.Class<L> getImplementationClass()
getImplementation(java.lang.String)
. The
class depends on the underlying logging framework (Log4J, SLF4J, etc.).
protected abstract L getImplementation(java.lang.String name)
null
since we should not use wrapper at all.
name
- The name of the logger.
null
if the target framework would redirect
to the Java logging framework.protected abstract java.util.logging.Logger wrap(java.lang.String name, L implementation)
name
- The name of the logger.implementation
- An implementation returned by getImplementation(java.lang.String)
.
protected abstract L unwrap(java.util.logging.Logger logger)
null
if none. If the specified logger is not an instance of the expected class,
then this method should returns null
.
logger
- The logger to test.
null
if none.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |