Package org.slf4j.helpers
Class NamedLoggerBase
- java.lang.Object
-
- org.slf4j.helpers.NamedLoggerBase
-
- All Implemented Interfaces:
Serializable,Logger
- Direct Known Subclasses:
MarkerIgnoringBase
abstract class NamedLoggerBase extends Object implements Logger, Serializable
Serves as base class for named logger implementation. More significantly, this class establishes deserialization behavior.- Since:
- 1.5.3
- Author:
- Ceki Gulcu
- See Also:
readResolve()
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringname-
Fields inherited from interface org.slf4j.Logger
ROOT_LOGGER_NAME
-
-
Constructor Summary
Constructors Constructor Description NamedLoggerBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Return the name of thisLoggerinstance.protected ObjectreadResolve()Replace this instance with a homonymous (same name) logger returned by LoggerFactory.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.slf4j.Logger
debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, error, error, error, error, error, error, error, error, error, error, info, info, info, info, info, info, info, info, info, info, isDebugEnabled, isDebugEnabled, isErrorEnabled, isErrorEnabled, isInfoEnabled, isInfoEnabled, isTraceEnabled, isTraceEnabled, isWarnEnabled, isWarnEnabled, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn
-
-
-
-
Field Detail
-
name
protected String name
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:LoggerReturn the name of thisLoggerinstance.
-
readResolve
protected Object readResolve() throws ObjectStreamException
Replace this instance with a homonymous (same name) logger returned by LoggerFactory. Note that this method is only called during deserialization.This approach will work well if the desired ILoggerFactory is the one references by LoggerFactory. However, if the user manages its logger hierarchy through a different (non-static) mechanism, e.g. dependency injection, then this approach would be mostly counterproductive.
- Returns:
- logger with same name as returned by LoggerFactory
- Throws:
ObjectStreamException
-
-