On Thu, 19 Jul 2001, Jonathan Reichhold wrote:

> > This hack definitely works.  As long as you're willing to pay the overhead
> > for the method call, it's essentially equivalent to asking Log4J whether
> > or not debugging output is enabled, which does something similar (but asks
> > the instantiated logger object, instead of being a static method).
> 
> I'm not sure if Log4j has an accesible boolean like this (maybe it
> does, haven't used it yet),

It's accessible, but via a method call.  That's still a *lot* cheaper than
doing useless string concatenations, but not quite as cheap as an integer
comparison.  I don't have the Log4J APIs available right at the moment,
but there's a call on the logger object that can be used to check for
enabled levels (or at least for debug).

Craig McClanahan

Reply via email to