You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Dominique Devienne <DD...@lgc.com> on 2004/07/01 10:36:07 UTC

RE: Is there a way to dual output log to terminal AND file?

Just own grain of salt on this:

If you want a pure Ant solution, use either <record> now, or someone
develops a CompositeBuildLogger to dispatch messages to more than one build
logger.

The quickest on Unix and a Unix-like toolkit on Windows (Cygwin or other) is
to use 'tee' to save to file and send to stdout at the same time. This must
be enabled in the script that launches Ant though, rather than in Ant
itself. --DD

-----Original Message-----
From: Woodchuck
To: Ant Users List
Sent: 6/30/2004 9:09 AM
Subject: Re: Is there a way to dual output log to terminal AND file?

i'm in windows and i made a .CMD file that i double-click to run my ant
build process.  here is my .CMD file:

@setlocal
@set TOMCAT_HOME="C:\Apache Group\Tomcat 4.1"
@set ANT_HOME=C:\apache_ant_1.6.1
@set JAVA_HOME=C:\j2sdk1.4.1_02
@set path=%PATH%;%ANT_HOME%\bin

@call ant -l build.log -lib %ANT_HOME%\lib -lib
%TOMCAT_HOME%\common\lib 
@type build.log
@pause

my solution has nothing to do with Ant really, the @type will display
the log file *after* ant has finished building whether successful or
unsuccessful

the @pause will keep the DOS window from closing automatically

just another possibility :)


--- Andrew Craig <an...@gmail.com> wrote:
> Use the <record> task.  At the top of your build file, put :
> 
> <record name="log.txt" action="start" />
> 
> The output still goes out to the terminal, but also goes through to
> the log.txt file.
> 
> On Tue, 29 Jun 2004 14:55:54 -0700, Chris Burbridge ( Temp )
> <ch...@autodesk.com> wrote:
> > 
> > Is there a way to have the logging output still go to the terminal,
> but also be saved to a file? (Preferably, something that I could
> specify from within the build file)?
> > 
> > Thanks!
> > 
> 
> 
> 
> 
> -- 
> Andrew
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
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