Stephen Colebourne wrote:
> Bruce Ashton wrote:
>> Log5j [ https://sourceforge.net/projects/log5j/ ] is essentially a log4j 
>> clone, but set up for Java versions 5 and above.  The main difference is 
>> slightly more flexible logging methods using Java 5's varargs feature.
> 
> Thanks for the info on a Joda-Time project.
> 
> You may want to test out varargs carefully though, as when they are 
> compiled, varargs get compiled to create a new array, and that array 
> will always be created if you are calling logger.log(Object...).
> 

That is correct, and in fact I've double up every debugging method - 
there is a log(Object) and log(Object...) method for each level. This 
mitigates that issue slightly, and I would argue that the cost of 
creating short-lived object arrays is still much less than string 
concatenation, especially with modern JVM's.  It's a trade-off of 
efficiency vs. flexibility.

Sorry, I don't mean to fill this mailing list up with off-topic posts, 
but I feel compelled to defend my design decisions ;)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to