ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@m64.com>
Subject RE: Recent logging aint emacs friendly
Date Sat, 08 Jul 2000 14:51:15 GMT
> From: Ernst de Haan [mailto:ernst@jollem.com]
> Sent: Sunday, 9 July 2000 0:15
> To: ant-dev@jakarta.apache.org
> Subject: Re: Recent logging aint emacs friendly
>
>
> Hi Conor && all,
>
> <snip>
> > Option 1 boils downs to a single logger class which has two behaviours
> > controlled by the command line parameter.
> >
> > Option 2 is 2 logger classes with separate behaviours.
> </snip>
>
> I would prefer the first option, because:
>
>    * I expect this to be `cleaner'
>    * I believe it is realistic that different logging formats are
>      requested in the future, like XML.
>
> We can start by refactoring the existing code to factor the logging
> stuff out and put it in a separate class. At the same time we can think
> about a generic interface or abstract superclass.
>

Ernst, this is already here and part of the benefit of the build events code
that Matt Foemmel contributed. Try

ant -listener org.apache.tools.ant.XmlLogger

You will have a log.xml file produced from your build. In the src/etc
directory there is a stylesheet that you can use with this XML file.

The way ant is currently working it adds a listener at startup which is the
default logger. The -listener option simply adds more listeners. Of course,
to be useable only one of the listeners can be writing to System.out.
Currently this is the DefaultLogger and it can't be changed.

With option2 you could use a different logger - something like

ant -logger emacs.logger -listener foo.bar

Option 1 is about changing the behaviour of the default logger. So something
like

ant -emacsMode -listener foo.bar


Thoughts?

Conor


Mime
View raw message