Do you use some tricks to make the compiler remove the debugging info completelly at build time? for ex, making isBebug() return a constant false value?
Luca David McReynolds wrote: > > On the last two struts projects we have adopted the policy of wrapping > our log4j info and debug statements in an if clause. > > if(logger.isBebug()) { > logger.debug("i am here"); > } > > 1. method call overhead is kept to a minimum. > 2. You can use the body to conditionally build a complex logging statement. > > if(logger.isBebug()) { > StringBuffer s = new StringBuffer(); > s.append("i am here now with x = ").append(this.x).append(" and y = > ").append(this.y); > logger.debug(s.toString()); > } > > Heck, since its a debug statement you might even allow the use of the > string concatenation operator (+) even though it is orders of > magnitude more costly in time and memory. > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]