I like the shorter version better. Is it always absolutely necessary to guard logging statements like that, though? Or only to save on the unnecessary processing when that level is disabled?
On 27 January 2014 19:47, Gary Gregory <garydgreg...@gmail.com> wrote: > Hi All, > > I think I brought this up a long time ago but I thought I'd give it a > refresh since we have a lot more voices participating in conversations. > Yes, I am aware of making source compatibility simple for porting from > version 1 but this is a naming issue that's always displeased me. > > I find the Logger#isLevelEnabled() method names unnecessarily verbose: > isDebugEnabled(), isTraceEnabled() and so on. > > Any likes to rename those simply to isDebug(), isTrace() and so on? > > I find this much more palatable: > > if (logger.isDebug()) { > logger.debug(...); > } > > vs. > > if (logger.isDebugEnabled()) { > logger.debug(...); > } > > ? > > Gary > > -- > E-Mail: garydgreg...@gmail.com | ggreg...@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 > -- Matt Sicker <boa...@gmail.com>