Costin Manolache wrote:
Stefan Bodewig wrote:


On Mon, 18 Aug 2003, <[EMAIL PROTECTED]> wrote:


Most of the time the debug messages are not logged by anyone

IIRC XmlLogger will log all levels.


And generates huge files that sometimes are almost useless.

agreed. But sometimes they are very useful.



I understand the use case and where you are getting at, I don't see a
backwards compatible way to change it, though.  I expect
BuildListeners to play a major role in IDE integration today, changing
the interface will break a lot of things.


If we make commons-logging/log4j/whatever as part of ant1.6, then in 1.6+
tasks can use it for _debug_ info. Things like the parameter used for javac or exec, or what files are beeing
copied can use that.


For backward compat, we could keep both paterns - if( project.debug ) -> use BuildListener to broadcast the info.
if( taskLog.debug || target.debug ) -> use commons-logging to debug.


It may seem like a huge amount of work - but it can be done incrementally,
and at least in my experience this "fine tunned" debug is needed the most in
few tasks ( javac, exec, copy, antcall and maybe few others )

Alternatively, Listeners could also support the commons-logging log interface, and we could upgrade all the existing ones to do so (though they may be subclassed; life is never simple). Then when running through the list of listeners to send notifications to, Ant determines the lowest common denominator of logging levels. If everything is commons based, then if any have isDebugEnabled() set, then debug is enabled. If not, well, we log at the relevant level. 'Legacy' Listeners are treated as if they are logged at isDebugEnabled()==true, and we can provide a bridge class to map from a commons logger interface to that of a classic listener -every above the bridge can use the commons.


The nice thing about the commons approach is that it lets complex code inside a task integrate properly with Ant's logging. As an example, Axis' axis-wsdl2java uses the commons logger; to date it is not aligned with Ant in logging modes.





W



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



Reply via email to