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 Andrés Camilo Bustamante <an...@gmail.com> on 2005/01/27 04:15:19 UTC

[Log4j] Bug 30201

Hi,

This is my first post to the developer list, I've read the guidelines but
I'm not completely sure if this is the correct way for reporting this kind
of things, so please by gentle ;)

I believe Bug 30201 is fixed in the current CVS version of Category.class.
This BUG is a request for enhancement to avoid the "hidden cost of parameter
building". The current request for enhancement was:

  ...
  log.debug("x=",x)
  ...

sugested implementation:

  void debug(String o1, Object o2)
  {
   if (isDebugEnabled()) debug(o1 + o2);
  }

The current version of Category.class has a bit more sophisticated way for
handling this use case:

  /**
   * Log a message with the <code>DEBUG</code> level with message formatting
   * done according to the value of <code>messagePattern</code> and
   * <code>arg</code> parameters.
   * <p>
   * This form avoids superflous parameter construction. Whenever possible,
   * you should use this form instead of constructing the message parameter
   * using string concatenation.
   *
   * @param messagePattern The message pattern which will be parsed and
formatted
   * @param arg The argument to replace the formatting element, i,e,
   * the '{}' pair within <code>messagePattern</code>.
   * @since 1.3
   */
   public void debug(Object messagePattern, Object arg)

So, it should be ok to close bug 30201.