Similar to AbstractLogger, it would be useful to have AbstractLoggerContext and possibly AbstractMarker (at least if that helps in this bug context). Regarding LogManager, that could use some sort of context of its own so that the LoggerContextFactory itself can be dynamically replaced after the system has already been loaded. I see that the other impls are extending LogManager to override a couple things, but any code involving finding the proper class loader to use for certain situations needs to be overridable for impls like OSGi.
On 26 February 2014 16:51, Ralph Goers <[email protected]> wrote: > I'd want to see what you are proposing before I would go along with that. > > Ralph > > > On Feb 26, 2014, at 1:36 PM, Matt Sicker <[email protected]> wrote: > > > > That reminds me. I think a lot of the interfaces could use abstract base > classes, too. At least the main ones like LoggerContext, Marker, the > Manager classes, etc. It does help with implementations. > > > > Matt Sicker > > > >> On Feb 26, 2014, at 4:19, "RainJ (JIRA)" <[email protected]> wrote: > >> > >> RainJ created LOG4J2-552: > >> ---------------------------- > >> > >> Summary: Logic of isInstanceOf are not consistent in > log4j-api's Log4jMarker and log4j-slf4j-impl's MarkerWrapper > >> Key: LOG4J2-552 > >> URL: https://issues.apache.org/jira/browse/LOG4J2-552 > >> Project: Log4j 2 > >> Issue Type: Bug > >> Components: API, SLF4J Bridge > >> Affects Versions: 2.0-rc1 > >> Reporter: RainJ > >> > >> > >> The logic of isInstanceOf is not consistent for Marker implements in > log4j-api's Log4jMarker and log4j-slf4j-iml's MarkerWrapper. > >> In Log4jMarker > >> --------------------------------------------- > >> @Override > >> public boolean isInstanceOf(final String name) { > >> if (name == null) { > >> throw new IllegalArgumentException("A marker name is > required"); > >> } > >> Marker toTest = this; > >> do { > >> if (name.equals(toTest.getName())) { > >> return true; > >> } > >> toTest = toTest.getParent(); > >> } while (toTest != null); > >> return false; > >> } > >> --------------------------------------------- > >> in MarkerWrapper > >> --------------------------------------------- > >> @Override > >> public boolean isInstanceOf(final Marker marker) { > >> if (marker == null) { > >> throw new IllegalArgumentException("A marker parameter is > required"); > >> } > >> > >> if (marker instanceof MarkerWrapper) { > >> return contains((MarkerWrapper) marker); > >> } else { > >> return contains(marker.getName()); > >> } > >> } > >> > >> @Override > >> public boolean isInstanceOf(final String name) { > >> if (name == null) { > >> throw new IllegalArgumentException("A marker name is > required"); > >> } > >> return contains(name); > >> } > >> ----------------------------------------- > >> > >> in Log4jMarker, the isInstanceOf means the marker is instance of itself > or its parent > >> > >> in MarkerWrapper, the isInstance of means the marker is instance of > itself or its children > >> > >> > >> > >> > >> -- > >> This message was sent by Atlassian JIRA > >> (v6.1.5#6160) > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [email protected] > >> For additional commands, e-mail: [email protected] > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Matt Sicker <[email protected]>
