Hi All:
I've thinking about adding 1, 2 and 3 arg variants to the Object... methods
in Logger to avoid paying the cost of creating Object arrays. This is
especially important when no logging takes place and I have a call like
logger.trace("this {} and that {}", this, that);
logger.debug("this {} and that {}", this, that);
But the idea of adding 3 extra method times the number of log levels is not
appealing.
So that go me to consider this call side pattern:
logger.trace.log.("this {} and that {}", this, that);
logger.debug.log("this {} and that {}", this, that);
where trace could be "trace()" a method, or "trace" a public ivar.
Obviously, this would eliminate the need to duplicate method patterns for
each level when we want new APIs.
Thoughts?
Gary
--
E-Mail: [email protected] | [email protected]
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