Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 35107 invoked by uid 500); 30 Nov 2001 19:33:13 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 35095 invoked from network); 30 Nov 2001 19:33:13 -0000 Content-Type: text/plain; charset="iso-8859-1" From: Peter Royal Organization: Pace Systems Group, Inc. To: cocoon-dev@xml.apache.org Subject: Re: Cocoon 2.0 Scalability Disappointment Date: Fri, 30 Nov 2001 14:01:15 -0500 X-Mailer: KMail [version 1.3.2] References: <20011130184953.19085.qmail@mail.supereva.it> In-Reply-To: <20011130184953.19085.qmail@mail.supereva.it> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Friday 30 November 2001 01:49 pm, you wrote: > > I think this can be an appropriate timing to start cleaning up the > > logging code. We have to find a policy and stick to it: I tend to say > > that we should *always* do a isDebugEnabled() or a isInfoEnabled() > > before spitting out Strings. I'm not that sure that such a policy should > > be enforced for levels of warn and above. > > I totally agree. > This sped up my app quite a bit. > Maybe a static utility method that does the check is nicers than many ifs. Assuming you are talking about something like: public static logDebug(final Logger logger, final String string) { if (logger.isDebugEnabled()) { logger.debug(string); } } that won't work because the point is to never reach the code that constructs the string. AFAIK it has to be done as if (getLogger().isDebugEnabled()) getLogger().debug("your message"); I followed Stefano's rant on this a month ago or so and have been changing all my code to the above syntax. Using a nifty IDE such as IDEA from IntelliJ, you can define templates in code, so i just type debug and it spits out if (getLogger().isDebugEnabled()) getLogger().debug(); with the cursor inbetween the debug() braces ready for the string. Makes it dead-easy. -pete -- peter royal -> proyal@managingpartners.com --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org