You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Mark Womack <wo...@adobe.com> on 2005/01/31 20:40:13 UTC

RE: No need to enclose parameterized messages in isEnabled checks

Thanks.  I will clean it up.

> -----Original Message-----
> From: Ceki Gülcü [mailto:ceki@qos.ch]
> Sent: Monday, January 31, 2005 10:27 AM
> To: log4j-dev@logging.apache.org
> Subject: No need to enclose parameterized messages in isEnabled checks
> 
> 
> Mark,
> 
> I noticed that you were using paramerizered log messages which is good. At
> the same time, you seem to enclosing them in isEnabledXXX() checks. Here
> is
> an example:
> 
>      if (this.getLogger().isDebugEnabled()) {
>        this.getLogger().debug("watchdog \"{}\" reconfiguring from url:
> {}",
>          this.getName(), srcURL);
>      }
> 
> There is no need for the isDebugEnabled() check. You can simply write
> 
>        this.getLogger().debug("watchdog \"{}\" reconfiguring from url:
> {}",
>          this.getName(), srcURL);
> 
> without loss of performance.
> 
> --
> Ceki Gülcü
> 
>    The complete log4j manual: http://www.qos.ch/log4j/
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org


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