ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ankita Kapadia" <ankita_kapa...@persistent.co.in>
Subject RE: How to echo date-time to log file?
Date Tue, 14 Sep 2004 13:23:49 GMT
Oops ! But this would echo only on the screen!

-----Original Message-----
From: Ankita Kapadia [mailto:ankita_kapadia@persistent.co.in]
Sent: Tuesday, September 14, 2004 6:51 PM
To: Ant Users List
Subject: RE: How to echo date-time to log file?


<target name="dobuild" depends="settings">
<tstamp>
<format property="start" pattern="yyyy MMMM dd HH:mm:ss" locale="en"/>
</tstamp>

<echo message="Current time and date: ${start}" />
<property name="starttime" value="${start}"/>
.......
</target>

<target name="buildsuccess" depends="dobuild">
<tstamp>
     <format property="NOW" pattern="yyyy MMMM dd HH:mm:ss" locale="en"/>
</tstamp>

<mail failonerror="false" ......" >
    <from name="xyz@persistent.co.in" address="xyz@persistent.co.in"/>
    <message>
...build status etc.......
 Build Start Time	: ${starttime}
 Build End Time		: ${NOW}
</message>
</target>



-----Original Message-----
From: Patrick Surry [mailto:Patrick.Surry@quadstone.com]
Sent: Tuesday, September 14, 2004 6:40 PM
To: Ant Users List
Subject: How to echo date-time to log file?


This seems like a stupid question (and probably is!) but I can't seem to
find
what I'm looking for anywhere obvious.  I have a build that takes a long
time,
and would like to be able to record the current date/time at various points
throughout the build.  Just like you get when you run in 'verbose' mode but
without all the extra verbosity.  Ideally I'd want something like a
'timestamp'
attribute in the echo task, so I could do things like:

<echo timestamp="true" message="Starting job..."/>
...
<echo timestamp="true" message="Finished job."/>

Are there any obvious solutions to this - running an exec with a 'time'
command
seems like a hack, <tstamp/> doesn't really do what I want; the ant-contrib
<stopwatch/> doesn't give absolute times, just differences; the <record/>
task
probably could change log verbosity to force ant-generated timestamps at
different points but again seems roundabout/overkill.

Patrick

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