ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dick, Brian E." <Brian.D...@FMR.com>
Subject RE: Matt Benson - Loadfile not loading file
Date Tue, 21 Sep 2004 20:14:36 GMT
Did you happen to get around to adding attributes to <redirector> as you mentioned below?
I could really use this feature now.

-----Original Message-----
From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
Sent: Wednesday, August 18, 2004 4:08 PM
To: Ant Users List
Subject: RE: Loadfile not loading file


Oh... gotcha.  Yeah, the workaround works but the
problem you noted is completely unsurprising.

To tee the output that way... I will make a note to
see about adding attributes to <redirector> to force
redirected output to go to the logging mechanism as
well as files/properties etc.  For now, I would
suggest switching from <foreach> to <for> (if
possible) to cut down overhead and use a single
<record action="start"> and <record action="stop">
pair with the <for> invocation in between.

-Matt

--- "Dick, Brian E." <Brian.Dick@FMR.com> wrote:

> The target that starts/stops the recorder is
> repeatedly called by a foreach task. After the first
> call, the file doesn't change anymore. Bummer.
> 
> Is there another way to "tee" output to the console
> and a file?
> 
> BTW, I'm using Windows XP.
> 
> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
> Sent: Wednesday, August 18, 2004 3:10 PM
> To: Ant Users List
> Subject: RE: Loadfile not loading file
> 
> 
> Umm... you mean aside from the fact that the
> recorder
> was called with the stop action?
> 
> -Matt
> 
> P.S. When I reproduced the error on Win2k, the
> subsequent <echo> didn't help.
> 
> 
> --- "Dick, Brian E." <Brian.Dick@FMR.com> wrote:
> 
> > I just found a nasty side effect of your work
> > around. Looks like the echo maybe closing the file
> > for the record task. On subsequent calls to the
> > record task, nothing is being written to the file.
> > 
> > -----Original Message-----
> > From: Jan.Materne@rzf.fin-nrw.de
> > [mailto:Jan.Materne@rzf.fin-nrw.de] 
> > Sent: Wednesday, August 18, 2004 9:59 AM
> > To: user@ant.apache.org
> > Subject: AW: Loadfile not loading file
> > 
> > 
> > Seems to be a bug. But I dont know where (and
> havent
> > the time at the
> > moment...)
> > I´ll open a bug [1].
> > 
> > Jan
> > 
> > 
> > [1]
> >
>
http://issues.apache.org/bugzilla/show_bug.cgi?id=30728
> > 
> > 
> > > -----Ursprüngliche Nachricht-----
> > > Von: Dick, Brian E. [mailto:Brian.Dick@FMR.com]
> > > Gesendet am: Mittwoch, 18. August 2004 15:54
> > > An: Ant Users List
> > > Betreff: RE: Loadfile not loading file
> > > 
> > > That worked. Thanks.
> > > 
> > > -----Original Message-----
> > > From: Jan.Materne@rzf.fin-nrw.de
> > [mailto:Jan.Materne@rzf.fin-nrw.de] 
> > > Sent: Wednesday, August 18, 2004 9:49 AM
> > > To: user@ant.apache.org
> > > Subject: AW: Loadfile not loading file
> > > 
> > > 
> > > Insert a
> > >        <echo file="log.txt" append="true">
> </echo>
> > > after the 
> > >        <record name="log.txt" action="stop"/>
> > > statemtent.
> > > 
> > > The recorder wont flush the conent when you do
> the
> > action=stop.
> > > 
> > > When executing the example with -debug you´ll
> see
> > only
> > > --8-<-----8-<-----8-<-----8-<---
> > > myexec:
> > >      [echo] Ant-Version: Apache Ant version
> > 1.7alpha compiled 
> > > on July 15
> > > 2004
> > > setting a recorder for name log.txt
> > >      [echo] ERROR
> > > setting a recorder for name log.txt
> > >  [loadfile] loading C:\TEMP\anttest\log.txt into
> > property log.property
> > >  [loadfile] file size = 0
> > > Property ${log.property} has not been set
> > > --8-<-----8-<-----8-<-----8-<---
> > > 
> > > no flush before <loadfile> as you could think
> > after reading
> > > RecorderEntry.taskFinished()
> > > 
> > > RecEntry:0157:     public void
> > taskFinished(BuildEvent event) {
> > > RecEntry:0158:         log("<<< TASK FINISHED --
> "
> > + event.getTask(),
> > > Project.MSG_DEBUG);
> > > RecEntry:0159:         out.flush();
> > > RecEntry:0160:     }
> > > 
> > > 
> > > Here my example
> > > 
> > > <?xml version="1.0" encoding="ISO-8859-1"?>
> > > <project name="test" basedir="."
> default="myexec">
> > > 
> > >     <target name="myexec">
> > >        <echo>Ant-Version: ${ant.version}</echo>
> > >        <record name="log.txt" action="start"/>
> > >        <echo message="ERROR"/>
> > >        <record name="log.txt" action="stop"/>
> > > 
> > >        <echo file="log.txt" append="true">
> </echo>
> > > 
> > >        <loadfile property="log.property"
> > srcfile="log.txt"/>
> > >        <condition property="log.error">
> > >           <contains string="${log.property}"
> > substring="ERROR"/>
> > >        </condition>
> > >        <echo>File</echo>
> > >       
> >
>
<echo>============================================</echo>
> > >        <concat><fileset dir="."
> > includes="log.txt"/></concat>
> > >       
> >
>
<echo>============================================</echo>
> > >        <echo>log.property =
> ${log.property}</echo>
> > >        <echo>log.error    = ${log.error}</echo>
> > >        <fail if="log.error"/>
> > >     </target>
> > > 
> > > </project>
> > > 
> > > 
> > > Jan
> > > 
> > > 
> > > 
> > > 
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: Dick, Brian E.
> [mailto:Brian.Dick@FMR.com]
> > > > Gesendet am: Mittwoch, 18. August 2004 15:31
> > > > An: Ant Users List
> > > > Betreff: RE: Loadfile not loading file
> > > > 
> > > > log.txt contains the string ERROR
> > > > <echo message="${log.property}"/> displays
> > "${log.property}" 
> > > > (it's not set)
> > > > <echo message="${log.error}"/> displays
> > "${log.error}" 
> > > (it's not set)
> > > > 
> > > > You can test the code below with a minor
> change.
> > Replace the 
> > > > exec task with
> > > > 
> > > > <echo message="ERROR"/>
> > > > 
> > > > -----Original Message-----
> > > > From: Jan.Materne@rzf.fin-nrw.de 
> > [mailto:Jan.Materne@rzf.fin-nrw.de] 
> > > Sent: Wednesday, August 18, 2004 9:21 AM
> > > To: user@ant.apache.org
> > > Subject: AW: Loadfile not loading file
> > > 
> > > 
> > > Have you checked:
> > > - the log.txt (using viewing into that)
> > > - the log.property (using <echo>)
> > > - the log.error (using <echo>)
> > > 
> > > Are their content what you are expecting?
> > > 
> > > 
> > > Jan
> > > 
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: Dick, Brian E.
> [mailto:Brian.Dick@FMR.com]
> 
=== message truncated ===



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
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


Mime
View raw message