Package org.slf4j.helpers
Class NamedLoggerBase
- java.lang.Object
-
- org.slf4j.helpers.NamedLoggerBase
-
- All Implemented Interfaces:
java.io.Serializable
,Logger
- Direct Known Subclasses:
MarkerIgnoringBase
abstract class NamedLoggerBase extends java.lang.Object implements Logger, java.io.Serializable
Serves as base class for named logger implementation. More significantly, this class establishes deserialization behavior.- Since:
- 1.5.3
- See Also:
readResolve()
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
name
private static long
serialVersionUID
-
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 java.lang.String
getName()
Return the name of thisLogger
instance.protected java.lang.Object
readResolve()
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
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
name
protected java.lang.String name
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:Logger
Return the name of thisLogger
instance.
-
readResolve
protected java.lang.Object readResolve() throws java.io.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:
java.io.ObjectStreamException
-
-