ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Stirling" <>
Subject Re: Ant log statements being created even when not used
Date Mon, 25 Sep 2006 13:35:08 GMT
Wow, I got filtered by the mail server for saying d*** in an email to
the list. Apache lists used to be a lot more relaxed about profanity.
Here's my email minus the expletive:

What's wrong with a guard statement that doesn't construct the log
message unless the log level at which the message is used is enabled?


if (LOG.isDebugEnabled()) {
   StringBuilder msg = new StringBuilder();

That's simple, don't you think? In my experience, the problem of
polluting "client" code with logging is a red herring and not such a
problem. More common are the problems of not enough useful logging or
too much logging, e.g., when every component in an application stack
is coded to log the same thing so you wind up with massive stack
traces logged multiple times by well-meaning components that should
often just be throwing their exceptions up to a higher layer for
logging and other handling.

Scott Stirling
Framingham, MA

On 9/25/06, Kevin Jackson <> wrote:
> Hi,
> Remember early this year I had a problem with a build that basically
> ran out of memory and if I commented out logging code I could get it
> to run?
> This explains exactly the problem (and a solution for D), I wonder if
> some solution exists for Java such that log statements are not as
> wasteful of resources as they currently are
> Kev
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message