You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2015/08/29 21:07:37 UTC

Name org.apache.logging.log4j.junit.InitialLoggerContext class

Hi All,

I was going to write a couple of blog posts this weekend about log4j and I
was going to start by talking about how useful our InitialLoggerContext
test class is to isolate logging configs for specific tests, but I find the
class name misleading. The class is a JUnit Rule so it should be postfixed
with "Rule" IMO and the "Initial" prefix is just weird, initial as opposed
to what? We have no other LoggerContext JUnit rules. I would not mind
renaming this class to LoggerContextRule. That name is clear and there can
be no mistake that this is not a special kind of LoggerContext. I could
even go for LoggerContextJUnitRule to make it clear that it is for use with
JUnit and not in any other kind of code.

Thoughts?

Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Name org.apache.logging.log4j.junit.InitialLoggerContext class

Posted by Gary Gregory <ga...@gmail.com>.
On Sat, Aug 29, 2015 at 1:42 PM, Ralph Goers <ra...@dslextreme.com>
wrote:

> I too have found that name a bit confusing. It actually kind of makes me
> think it is somehow a subclass of InitialContext.
>
> Either one of your proposed names is fine with me.  I guess I prefer
> LoggerContextRule simply because it is slightly shorter and we don’t
> support any other “Rule” types that I am aware of.
>

Done: LoggerContextRule.

Gary

>
> Ralph
>
> On Aug 29, 2015, at 12:07 PM, Gary Gregory <ga...@gmail.com> wrote:
>
> Hi All,
>
> I was going to write a couple of blog posts this weekend about log4j and I
> was going to start by talking about how useful our InitialLoggerContext
> test class is to isolate logging configs for specific tests, but I find the
> class name misleading. The class is a JUnit Rule so it should be postfixed
> with "Rule" IMO and the "Initial" prefix is just weird, initial as opposed
> to what? We have no other LoggerContext JUnit rules. I would not mind
> renaming this class to LoggerContextRule. That name is clear and there can
> be no mistake that this is not a special kind of LoggerContext. I could
> even go for LoggerContextJUnitRule to make it clear that it is for use with
> JUnit and not in any other kind of code.
>
> Thoughts?
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Name org.apache.logging.log4j.junit.InitialLoggerContext class

Posted by Ralph Goers <ra...@dslextreme.com>.
I too have found that name a bit confusing. It actually kind of makes me think it is somehow a subclass of InitialContext.

Either one of your proposed names is fine with me.  I guess I prefer LoggerContextRule simply because it is slightly shorter and we don’t support any other “Rule” types that I am aware of.

Ralph

> On Aug 29, 2015, at 12:07 PM, Gary Gregory <ga...@gmail.com> wrote:
> 
> Hi All,
> 
> I was going to write a couple of blog posts this weekend about log4j and I was going to start by talking about how useful our InitialLoggerContext test class is to isolate logging configs for specific tests, but I find the class name misleading. The class is a JUnit Rule so it should be postfixed with "Rule" IMO and the "Initial" prefix is just weird, initial as opposed to what? We have no other LoggerContext JUnit rules. I would not mind renaming this class to LoggerContextRule. That name is clear and there can be no mistake that this is not a special kind of LoggerContext. I could even go for LoggerContextJUnitRule to make it clear that it is for use with JUnit and not in any other kind of code.
> 
> Thoughts?
> 
> Gary
> 
> -- 
> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org  <ma...@apache.org>
> Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/> 
> Home: http://garygregory.com/ <http://garygregory.com/>
> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>

Re: Name org.apache.logging.log4j.junit.InitialLoggerContext class

Posted by Xen <xe...@dds.nl>.
Ha, you can make it PrimaryJUnitLoggerContextRule if you want ;-).

or PrimaryLoggerContextJUnitRule ;-).

Regards.

On Sat, 29 Aug 2015, Gary Gregory wrote:

> Hi All,
>
> I was going to write a couple of blog posts this weekend about log4j and I
> was going to start by talking about how useful our InitialLoggerContext
> test class is to isolate logging configs for specific tests, but I find the
> class name misleading. The class is a JUnit Rule so it should be postfixed
> with "Rule" IMO and the "Initial" prefix is just weird, initial as opposed
> to what? We have no other LoggerContext JUnit rules. I would not mind
> renaming this class to LoggerContextRule. That name is clear and there can
> be no mistake that this is not a special kind of LoggerContext. I could
> even go for LoggerContextJUnitRule to make it clear that it is for use with
> JUnit and not in any other kind of code.
>
> Thoughts?
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org