ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Proposal: XML output from ant tasks
Date Thu, 24 Feb 2000 10:01:43 GMT

It seems text output is very important, and most people find XML hard to
read. Filtering the logs in real time to remove the markup is too complex.

The real problem ( IMHO ) is to avoid losing the structure. 
<copy> can generate a log like <log:copy src="foo" dst="bar"/> 
As text it will be plain english "copy: Copy foo to bar", and it's easier
to read.

I don't think anyone can find a perfect solution, you win and lose
something whatever you do. 

In my experience, most of the time a program is supposed to just run. 
The log is used to:
1. investigate problems, bugs
2. extract informations about program activity

It's clear that for (1) plain text is better, while for (2) xml will
reolve a lot of problems. The common solution is to use 1 and then write 
a parser for the log file for processing - see log analyzers for httpd
or sendmail. 

I used few - and most of the time a "log processor" can only do a limited
and hardcoded set of operations - total trafic, per-domain, etc. A
sendmail log processor will probably have problems with qmail or with
older versions of sendmail. For web we have a "common" format, but it's
limited and hard to extend ( and not so easy to manipulate in a program - 
you need to parse it first)

With xml output you can easily use (common) tools to do arbitrary
processing. It is even possible to easily import the data into a database
( not so important for ant, but for tomcat). You can have the nightly
build send you a nice formated report if something fails, or you can have
a tool that calls ant and display what you want.

My preference is to make automatic processing easier with the price of
convenience and aspect ( and it is still possible to use a tool that will
display the log in a nice format !). 

Ant is special because it's extensible - you'll never be able to find a
common and parseable text output, tasks are too diverse. Even for sendmail
and http, only a subset of the information is parsed and processed.

Anyway - it's just an ideea and it's a matter of choice, so speak up :-) 
Just be sure you consider both sides of the story.


>    Instead of a series of XML fragments, if we are going to do XML, we
>    should make sure that it is well formed.  For starters, it means that
>    everything needs to be nested inside of a single XML element.
>    Furthermore, we need to ensure that special characters such as
>    ampersands and double quotes are handled correctly inside of logged
>    output.
>    When outputing the XML, the default should be verbose.  In fact, I'm not
>    sure I would see a need for a verbose option (or conversely, a terse
>    option) any more.
> - Sam Ruby

View raw message