Re: Ant log statements being created even when not used

2006-09-27 Thread Jeffrey E Care
gt; > Jan > > > > >-Ursprüngliche Nachricht- > > >Von: Scott Stirling [mailto:[EMAIL PROTECTED] > > >Gesendet: Montag, 25. September 2006 15:29 > > >An: Ant Developers List > > >Betreff: Re: Ant log statements being created even when no

Re: Ant log statements being created even when not used

2006-09-25 Thread Dominique Devienne
*when* it's necessary. In the example/article D uses lazy or partial evaluation to sort of get around this. In other languages there are other mechanisms. In Java perhaps there's a way of refactoring the logging such that Strings are re-used (use static final String and build logging from them?

Re: Ant log statements being created even when not used

2006-09-25 Thread Kevin Jackson
First, Thanks for the thoughtful responses. I'm beginnning to understand how the Ant logging mechanism works now :) Second, I agree 1.7 cannot be changed at this late date to fit in a logging cludge! Third, I came across the problem with a particularly long-running build, and it was less of a

Re: Ant log statements being created even when not used

2006-09-25 Thread Stefan Bodewig
On Mon, 25 Sep 2006, Peter Reilly <[EMAIL PROTECTED]> wrote: > On 9/25/06, Dominique Devienne <[EMAIL PROTECTED]> wrote: >> Regarding dynamic log level, I think it's reasonnable to have tasks >> locally cache the current min log level at the beginning of its >> execute() method, for example. > >

Re: Ant log statements being created even when not used

2006-09-25 Thread Stefan Bodewig
On Mon, 25 Sep 2006, Steve Loughran <[EMAIL PROTECTED]> wrote: > +1 to -at-some-point-in-the-future- having a way to query log levels > > + 1 to mapping 1:1 with commons-logging/log4j/java1.4 tracing and > implementing the relevant bridge classes. > > + 1 to letting the end users tune the log in

Re: Ant log statements being created even when not used

2006-09-25 Thread Stefan Bodewig
On Mon, 25 Sep 2006, Scott Stirling <[EMAIL PROTECTED]> wrote: > 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? > > i.e.: > > if (LOG.isDebugEnabled()) { Nobody, except for the BuildListener knows wheth

Re: Ant log statements being created even when not used

2006-09-25 Thread Stefan Bodewig
On Mon, 25 Sep 2006, Scott Stirling <[EMAIL PROTECTED]> wrote: > 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. I received your email, including the d*** - and so did the mailing list archive. Must h

Re: Ant log statements being created even when not used

2006-09-25 Thread Peter Reilly
On 9/25/06, Dominique Devienne <[EMAIL PROTECTED]> wrote: > +1 to -at-some-point-in-the-future- having a way to query log levels This is all I proposed ATM. > + 1 to mapping 1:1 with commons-logging/log4j/java1.4 tracing and > implementing the relevant bridge classes. This can be done separat

Re: Ant log statements being created even when not used

2006-09-25 Thread Dominique Devienne
+1 to -at-some-point-in-the-future- having a way to query log levels This is all I proposed ATM. + 1 to mapping 1:1 with commons-logging/log4j/java1.4 tracing and implementing the relevant bridge classes. This can be done separately of the work in Ant core. + 1 to letting the end users tun

Re: Ant log statements being created even when not used

2006-09-25 Thread Steve Loughran
Dominique Devienne wrote: To account for long lived listener, we would also need a method on project to reset the cache of the current level, which would be initialized any time a new listener is added. --DD The use case for this would be a hypothetical CruiseControl (for example) listener whos

Re: Ant log statements being created even when not used

2006-09-25 Thread Scott Stirling
There you go! I was beginning to think the listeners would register with their log level as an added parameter, but this makes more sense. Scott S. Framingham, MA On 9/25/06, Dominique Devienne <[EMAIL PROTECTED]> wrote: > I don't know if there's a useful answer to be found. Note unless we add

Re: Ant log statements being created even when not used

2006-09-25 Thread Dominique Devienne
To account for long lived listener, we would also need a method on project to reset the cache of the current level, which would be initialized any time a new listener is added. --DD The use case for this would be a hypothetical CruiseControl (for example) listener whose log level could be dynami

Re: Ant log statements being created even when not used

2006-09-25 Thread Matt Benson
g > [mailto:[EMAIL PROTECTED] > > >Gesendet: Montag, 25. September 2006 15:29 > > >An: Ant Developers List > > >Betreff: Re: Ant log statements being created > even when not used > > > > > >What's wrong with a guard statement tha

Re: Ant log statements being created even when not used

2006-09-25 Thread Dominique Devienne
I don't know if there's a useful answer to be found. Note unless we add a new interface (LogListener2) which adds the ability to query the current level of any listener. We could then extract the min. level when all current listener support this new listener, and if any listener does not implem

Re: Ant log statements being created even when not used

2006-09-25 Thread Scott Stirling
registered Listeners. Jan >-Ursprüngliche Nachricht- >Von: Scott Stirling [mailto:[EMAIL PROTECTED] >Gesendet: Montag, 25. September 2006 15:29 >An: Ant Developers List >Betreff: Re: Ant log statements being created even when not used > >What's wrong with a guard

Re: Ant log statements being created even when not used

2006-09-25 Thread Matt Benson
Hi Kev, this all sounds like closures or other form of first class functions to me. I know I've seen a lot of discussion at IIRC JavaLobby etc. on whether Java needs closures... but in any event new language features don't help us in Ant development because we stick to BC. I was thinking of addin

Re: Ant log statements being created even when not used

2006-09-25 Thread Scott Stirling
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? i.e.: if (LOG.isDebugEnabled()) { StringBuilder msg = new StringBuilder(); msg.append(etc); [...] LOG.debug(msg.toString()); } That's simple,

Re: Ant log statements being created even when not used

2006-09-25 Thread Scott Stirling
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