Looks good - thanks! A LoggerContext is always created by a ContextSelector. The three implementations that exist always provide a name. However, at the moment a user could create their own selector that doesn't.
Ralph On Sep 28, 2012, at 12:21 PM, Gary Gregory wrote: > OK, here is an example of what I committed: > > LoggerTest:TRACE in sun.misc.Launcher$AppClassLoader@1ea2dfe > > Can a Logger's context ever be null? getParent() does not guard for this but > I am toString() check to avoid NPEs. > > Can a LogerContext's name ever be null? The LC constructor does not check. > > Gary > > On Wed, Sep 26, 2012 at 5:05 PM, Ralph Goers <[email protected]> > wrote: > I think that is a good idea. I would add the LoggerContext name to the string > if one is there. > > Ralph > > > > On Sep 26, 2012, at 1:52 PM, Gary Gregory wrote: > >> Hi All: >> >> I was doing some debugging in a 1.2 app and was annoyed that >> Logger.toString() did nothing helpful. >> >> Any objection to implementing >> org.apache.logging.log4j.core.Logger.toString()? >> >> How about {name}:{level}? For example, "com.foo.Bar:INFO" or >> "com.foo.Bar@INFO" >> >> Gary >> >> -- >> E-Mail: [email protected] | [email protected] >> JUnit in Action, 2nd Ed: http://bit.ly/ECvg0 >> Spring Batch in Action: http://bit.ly/bqpbCK >> Blog: http://garygregory.wordpress.com >> Home: http://garygregory.com/ >> Tweet! http://twitter.com/GaryGregory > > > > > -- > E-Mail: [email protected] | [email protected] > JUnit in Action, 2nd Ed: http://bit.ly/ECvg0 > Spring Batch in Action: http://bit.ly/bqpbCK > Blog: http://garygregory.wordpress.com > Home: http://garygregory.com/ > Tweet! http://twitter.com/GaryGregory
