commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject RE: how should log levels work? [Was Re: [Logging] default log level]
Date Thu, 10 Jan 2002 18:59:07 GMT


On Thu, 10 Jan 2002, Scott Sanders wrote:

> Date: Thu, 10 Jan 2002 10:45:00 -0800
> From: Scott Sanders <ssanders@nextance.com>
> Reply-To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> Subject: RE: how should log levels work? [Was Re: [Logging] default log
>     level]
>
> Does this also remove the isInfoEnabled and isDebugEnabled?
>

Please do *not* consider removing these.  They are for performance
optimization.  Consider:

  if (log.isDebugEnabled()) {
    log.debug("Big " + "long " + "string " + "with " +
              "lots " + "of " + "concatenations");
  }

You definitely do *not* want to waste the time to do all the string
manipulations if the message is not going to be logged anyway.

I'm OK on removing setLevel(), but do not see a problem with getLevel().
Could someone expand on what concerns this might raise?

Craig


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message