ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David McTavish <dmctav...@sandvine.com>
Subject RE: altering logger by target
Date Thu, 07 Aug 2003 15:32:27 GMT
excellent idea. I'll give it a whirl. :)
d.


-----Original Message-----
From: Claudio Corsi [mailto:ccorsi@progress.com]
Sent: Thursday, August 07, 2003 11:33 AM
To: Ant Users List
Subject: Re: altering logger by target


David,

I have a suggestion that might help.

Implement your own version of the Logger, for examples extend the 
DefaultLoggger.

Overide the targetStart and targetFinished method.

You then check for the the test.unit target.

At that point, you can update the OutputPrintStream and ErrorPrintStream 
with your own that will be able to print the output more cleanly. I 
would consider the PrintStream to redirect the output to the original 
PrintStreams.

When you are then exiting the target, you can replace your 
OutputPrintStream and ErrorPrintStream with the original ones.

Note, I have not tested this but it seems logical enough to work.

--Claudio

David McTavish wrote:
> Is it possible to change the logger being used (Ant 1.5.3) on a per-target
> basis? I'm thinking 'no', but am hoping for creative ideas...
> Overview of the problem is as follows:
> 
> - user invokes target A which compiles and deploys our product. (I wish to
> use default logger here)
> - target A invokes target "test.unit" which runs our junit test suite (I
> wish to use a different logger to format the junit output a little more
> cleanly)
> - target A invokes some other processes which should use the default
logger
> again
> 
> Any ideas are more than appreciated!
> 
> thx,
> d.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message