Nevermind.... this trick doesn't apply to sub-elements, only to tasks.
Stefan's suggestion is the way to have direct easy access to Ant's logging
capabilities in sub-elements.

My preference would be to use a different pattern such that sub-elements
have no dependency on Ant classes or API's at all - and develop a way for
your task and sub-elements to communicate with one another for logging.

    Erik



----- Original Message -----
From: "Erik Hatcher" <[EMAIL PROTECTED]>
To: "Ant Developers List" <[EMAIL PROTECTED]>
Sent: Friday, June 07, 2002 2:55 PM
Subject: Re: Subelements and logging


> Would implementing a setProject method work for sub-elements?  It works
for
> tasks that don't extend from Task, but I'm guessing this would probably
work
> for other types too.  That would keep the Ant dependency off your
> inheritance hierarchy, at least.
>
>     Erik
>
> ----- Original Message -----
> From: "Stefan Bodewig" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, June 07, 2002 2:25 AM
> Subject: Re: Subelements and logging
>
>
> > On Thu, 6 Jun 2002, Erik Hatcher <[EMAIL PROTECTED]>
> > wrote:
> >
> > > The best way to output messages is to use the log() methods that are
> > > part of Task.
> >
> > Another option is to extend from ProjectComponent (which means you
> > class is no longer independent of Ant and can't have a different
> > super-class, of course) and use getProject().log().
> >
> > Stefan
> >
> > --
> > To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


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

Reply via email to