ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: [myrmidon] Logging fails after <exec> task; patch with possible solution.
Date Thu, 21 Feb 2002 12:37:03 GMT
On Thu, 21 Feb 2002 17:53, Darrell DeBoer wrote:
> I've just started playing around with the myrmidon Ant2 proposal, as I'm
> hoping to get involved. 

Wooohooo!

> While running a few of the sample targets, I
> noticed that after any <exec> task, no further messages are logged. This is
> due to the fact that o.a.aut.nativelib.impl.ProcessMonitor is shutting down
> all streams after the Process has been executed.  Because
> o.a.myrmidon.framework.Execute.executeNativeProcess() is passing in
> System.out, this is being closed, preventing any further messages to the
> console.

ewww!

> The supplied patch fixes this by making the code that creates the Stream
> responsible for closing them. I added a flag to ProcessMonitor to
> optionally force it close the Streams when the Process terminates, but I
> would imagine that this would be only used for monitoring an asynchronous
> Process.

Sounds reasonable to me.

> However, an alternative would be to make the ExecManager.execute() contract
> clearly specify that all Streams will be closed, and make sure that
> o.a.myrmidon.framework.Execute.executeNativeProcess() doesn't pass in
> System.out, but instead passes in an OutputStream that can be safely
> closed.
>
> If the latter is a preferable solution, I'd be happy to do up a patch for
> that.

I prefer the first approach and will apply your patch next time I reboot 
intow windows - thanks!

-- 
Cheers,

Pete

*------------------------------------------------------*
| "Computers are useless. They can only give you       |
|            answers." - Pablo Picasso                 |
*------------------------------------------------------*

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message