e.g.
boolean trace=log.isTraceEnabled(); loop { if(trace) ... }
Unfortunately, isTraceEnabled() is not free in most scenarios, so the cost of invoking this method should be amortized over multiple calls.
I don't want to cache this at a global level, or else we wouldn't be able to change the log level at runtime...