Browse Source

Bug 36053 + some more additional infos to <echo>

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@321319 13f79535-47bb-0310-9956-ffa450edef68
master
Jan Materne 19 years ago
parent
commit
9b2c22b77a
1 changed files with 69 additions and 12 deletions
  1. +69
    -12
      docs/manual/CoreTasks/echo.html

+ 69
- 12
docs/manual/CoreTasks/echo.html View File

@@ -13,10 +13,10 @@
<p>Echoes a message to the current loggers and listeners which <p>Echoes a message to the current loggers and listeners which
means <tt>System.out</tt> unless overridden. A <tt>level</tt> means <tt>System.out</tt> unless overridden. A <tt>level</tt>
can be specified, which controls at what logging level the message is can be specified, which controls at what logging level the message is
filtered at.
<p>
filtered at.
<p>
The task can also echo to a file, in which case the option to append rather The task can also echo to a file, in which case the option to append rather
than overwrite the file is available, and the <tt>level</tt> option is
than overwrite the file is available, and the <tt>level</tt> option is
ignored</p> ignored</p>
<h3>Parameters</h3> <h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0"> <table border="1" cellpadding="2" cellspacing="0">
@@ -38,19 +38,20 @@ ignored</p>
</tr> </tr>
<tr> <tr>
<td valign="top">append</td> <td valign="top">append</td>
<td valign="top">Append to an existing file?</td>
<td valign="top">Append to an existing file (or
<a href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileWriter.html#FileWriter(java.lang.String, boolean)" target="_blank">
open a new file / overwrite an existing file</a>)?
</td>
<td valign="top" align="center">No - default is false.</td> <td valign="top" align="center">No - default is false.</td>
</tr> </tr>
<tr> <tr>
<td valign="top">level</td> <td valign="top">level</td>
<td valign="top">Control the level at which this message is reported. <td valign="top">Control the level at which this message is reported.
One of "error", "warning", "info", "verbose", "debug"</td>
One of "error", "warning", "info", "verbose", "debug" (decreasing order)</td>
<td valign="top" align="center">No - default is "warning".</td> <td valign="top" align="center">No - default is "warning".</td>
</tr> </tr>
</table> </table>

<h3>Examples</h3> <h3>Examples</h3>
<pre> <pre>
&lt;echo message=&quot;Hello, world&quot;/&gt; &lt;echo message=&quot;Hello, world&quot;/&gt;
@@ -82,7 +83,7 @@ W3C Recommendation 04 February 2004 / End of Line handling
A message which only appears in <tt>-debug</tt> mode. A message which only appears in <tt>-debug</tt> mode.
<pre>&lt;echo level=&quot;error&quot;&gt; <pre>&lt;echo level=&quot;error&quot;&gt;
Imminent failure in the antimatter containment facility. Imminent failure in the antimatter containment facility.
Please withdraw to safe location at least 50km away.
Please withdraw to safe location at least 50km away.
&lt;/echo&gt; &lt;/echo&gt;
</pre> </pre>
A message which appears even in <tt>-quiet</tt> mode. A message which appears even in <tt>-quiet</tt> mode.
@@ -92,12 +93,68 @@ java-1.3.1 -mx1024m ${project.entrypoint} $$*
&lt;/echo&gt;</pre> &lt;/echo&gt;</pre>
Generate a shell script by echoing to a file. Generate a shell script by echoing to a file.
Note the use of a double $ symbol to stop Ant Note the use of a double $ symbol to stop Ant
filtering out the single $ during variable expansion
<hr>
filtering out the single $ during variable expansion

<p>Depending on the loglevel Ant runs, messages are print out or silently
ignored:
<table>
<tr>
<th>Ant-Statement</th>
<th>-quiet, -q</th>
<th><i>no statement</th>
<th>-verbose, -v</th>
<th>-debug, -d</th>
</tr>
<tr>
<td><pre>&lt;echo message="This is error message." level="error" /&gt;</pre></td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
</tr>
<tr>
<td><pre>&lt;echo message="This is warning message." /&gt;</pre></td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
</tr>
<tr>
<td><pre>&lt;echo message="This is warning message." level="warning" /&gt;</pre></td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
</tr>
<tr>
<td><pre>&lt;echo message="This is info message." level="info" /&gt;</pre></td>
<td align="center">not logged</td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
</tr>
<tr>
<td><pre>&lt;echo message="This is verbose message." level="verbose" /&gt;</pre></td>
<td align="center">not logged</td>
<td align="center">not logged</td>
<td align="center">ok</td>
<td align="center">ok</td>
</tr>
<tr>
<td><pre>&lt;echo message="This is debug message." level="debug" /&gt;</pre></td>
<td align="center">not logged</td>
<td align="center">not logged</td>
<td align="center">not logged</td>
<td align="center">ok</td>
</tr>
</table>





<hr>
<p align="center">Copyright &copy; 2000-2002,2004-2005 The Apache Software Foundation. All rights <p align="center">Copyright &copy; 2000-2002,2004-2005 The Apache Software Foundation. All rights
Reserved.</p> Reserved.</p>


</body> </body>
</html> </html>


Loading…
Cancel
Save