logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <fly...@null.net>
Subject Category.log(Priority, x)
Date Thu, 09 Aug 2001 14:24:55 GMT


I have a function which is returning a boolean.  I would like to log all
return values and have the logging not suck down performance.

I've noticed in the manual that it says I should do this

if (category.isInfoEnabled() )  {
  category.log(Priority.INFO, ""+bMyReturnValue);

This would avoid the parameter concatenation if Info is not enabled.  If
log4j had a method like

log(Priority, boolean)  {
  if (isEnabled(Priority) )  {

wouldn't that allow me to only have a single line in my code like

category.log(INFO, bMyReturnValue)

and have equal performance?  If so, are there any reasons that such a
method does not exist?  or am I just be pedantic by only wanting the one



To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org

View raw message