You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by cm...@yahoo.com on 2001/07/18 20:49:17 UTC

Listener task

One of the "optional" tasks I need is <listener>. It will have the same
effect as a -listener option on the command line ( use the parameter to
create a class and add it to the project listeners ).

It's easy to do - but there are some problems:

- it needs to be specified under <project>, same as top-level properties
and taskdefs. This would allow it to eventually replace the default
logger before the first message.

- it will miss the events before it's execution. That's fine if listeners
are specified at the beggining and a dummy buildStarted is sent.


Does it sounds crazy ? Any chance to get this in the optional pack ?

If it does, can I at least ask for a "nologger" option that would start
ant without any listener ?

Costin





Re: Listener task

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 18 Jul 2001, <cm...@yahoo.com> wrote:

> One of the "optional" tasks I need is <listener>. It will have the
> same effect as a -listener option on the command line ( use the
> parameter to create a class and add it to the project listeners ).

So far I agree with Peter, it sounds like <record> (or better an
extension thereof).

> - it needs to be specified under <project>, same as top-level
> properties and taskdefs. This would allow it to eventually replace
> the default logger before the first message.

-listener doesn't replace the default logger.  Another point <record>
doesn't provide yet.

Why do you need to do this from within the build file instead of using
the command line switch?  I'm sure some contexts like GUMP or
CruiseControl wouldn't be too happy if you removed their loggers 8-)

> - it will miss the events before it's execution. That's fine if
> listeners are specified at the beggining and a dummy buildStarted is
> sent.

The task could certainly take care of this.

> Does it sounds crazy ?

A little 8-)

> can I at least ask for a "nologger" option that would start ant
> without any listener ?

ant -logger NullLogger

with a NullLogger class that is an empty implemenentation of the
BuildLogger interface?

Stefan

Re: Listener task

Posted by Peter Donald <do...@apache.org>.
On Thu, 19 Jul 2001 04:49, cmanolache@yahoo.com wrote:
> One of the "optional" tasks I need is <listener>. It will have the same
> effect as a -listener option on the command line ( use the parameter to
> create a class and add it to the project listeners ).
>
> It's easy to do - but there are some problems:
>
> - it needs to be specified under <project>, same as top-level properties
> and taskdefs. This would allow it to eventually replace the default
> logger before the first message.
>
> - it will miss the events before it's execution. That's fine if listeners
> are specified at the beggining and a dummy buildStarted is sent.
>
>
> Does it sounds crazy ? Any chance to get this in the optional pack ?

It actually sounds like Record task in core tasks. Does that suit your needs?

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*