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>

--Craeg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to