ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: PROPOSE: Property Trace Facility For Ant?
Date Thu, 10 Nov 2005 12:49:10 GMT
Craeg Strong wrote:
> Dominique Devienne wrote:
> 
>>
>> Changing an interface is a no-no of course.
>>
>>
>>
>> So far I think I like #1 best, i.e. adding a few overrides to the log
>> methods in ProjectComponent to support an additional category. I'm not
>> sure we'd need hierarchical categories a la Log4J or
>> java.util.logging. Makes it more complex, and we don't want to slow
>> down Ant's logging.  --DD
>>  
>>
> Yes, I see that this kind of approach would be simpler.  How about the 
> following:
> 
> A) enhance the Property task to log a message when it sets a property, 
> just like XmlProperty does, e.g.
> (2 lines of code)
> 
> [xmlproperty] foo:MUMBLE
> Setting project property: foo -> MUMBLE
> [property] foo:BARF
> Override ignored for property "foo"
> 
> B) enhance PropertyHelper to log a message when it resolves a property 
> in replaceProperties, e.g.
> (1 line of code)
> 
> Retrieving project property foo:MUMBLE
>                [echo] value is MUMBLE
> 
> The idea is that if you need to trace a particular property, say "foo" 
> you can grep the -debug output.  Not bad...
> 
> There are several options for when to print the log messages:
> 1) make it happen in debug, which makes debug even more verbose
> 2) add logging categories, so property traces only show up when you ask 
> for them
> 3) add a sixth logging category like MSG_TRACE which will include all 
> debug info + property trace (and maybe more)
> 
> (buildfile follows)
> <xmlproperty file="somefile.xml"/>  <!-- sets foo to MUMBLE -->
> <property name="foo" value="BARF"/>
> <target name="test">
>  <echo>value is ${foo}</echo>
> </target>
> 

Actually, I quite like the listener approach. We just need an extended 
listener; there is no reason the -listener command can't handle both types.

The nice thing about a listener is that it lets an IDE do fancy things 
like list all properties.

if we are going to do this, we should also extend the listener with info 
about every reference created.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message