private Object readResolve() throws ObjectStreamException {
        //
        // if the deserialized object is exactly an instance of Level
        //
        if (getClass() == Level.class) {
            return toLevel(level);
        }
        //
        // extension of Level can't substitute stock item
        //
        return this;
    }
Resolved deserialized level to one of the stock instances. May be overridden
in classes derived from Level.

@return resolved object.
@throws ObjectStreamException if exception during resolution.
log4j-over-slf4j/src/main/java/org/apache/log4j/Level.java