Please use

if (log.isDebugEnabled())
{
   log.debug("my expensive to construct message");
}

If you set

protected boolean debug;

somewhere in your code
 debug = log.isDebugEnabled() 

you gain an infinitesimal amount of time and provide many opportunities for people to 
break up to date logging by not resetting debug often enough.

The time consuming part of logging is constructing the message.  Checking the 
isxxxEnabled is almost free. (log4j reports <50 ns on a slow machine) Lets always do 
it the same way to minimize confusion.
______________________________________________________________________
View this jboss-dev thread in the online forums:
http://jboss.org/forums/thread.jsp?forum=66&thread=5895

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to