source: release-kits/lirk3/bin/ant-installer/web/manual1.6.2/manual/CoreTasks/recorder.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 5.5 KB
Line 
1<html>
2
3<head>
4<meta http-equiv="Content-Language" content="en-us">
5<title>Recorder Task</title>
6<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
7</head>
8
9<body>
10
11<h2><a name="log">Record</a></h2>
12<h3>Description</h3>
13<p>A recorder is a listener to the current build process that records the
14output to a file.</p>
15
16<p>Several recorders can exist at the same time. Each recorder is
17associated with a file. The filename is used as a unique identifier for
18the recorders. The first call to the recorder task with an unused filename
19will create a recorder (using the parameters provided) and add it to the
20listeners of the build. All subsequent calls to the recorder task using
21this filename will modify that recorders state (recording or not) or other
22properties (like logging level).</p>
23
24<p>Some technical issues: the file's print stream is flushed for &quot;finished&quot;
25events (buildFinished, targetFinished and taskFinished), and is closed on
26a buildFinished event.</p>
27
28<h3>Parameters</h3>
29<table border="1" cellpadding="2" cellspacing="0">
30 <tr>
31 <td valign="top"><b>Attribute</b></td>
32 <td valign="top"><b>Description</b></td>
33 <td align="center" valign="top"><b>Required</b></td>
34 </tr>
35 <tr>
36 <td valign="top">name</td>
37 <td valign="top">The name of the file this logger is associated with.</td>
38 <td align="center" valign="middle">yes</td>
39 </tr>
40 <tr>
41 <td valign="top">action</td>
42 <td valign="top">This tells the logger what to do: should it start
43 recording or stop? The first time that the recorder task is called for
44 this logfile, and if this attribute is not provided, then the default
45 for this attribute is &quot;start&quot;. If this attribute is not provided on
46 subsequent calls, then the state remains as previous.
47 [Values = {start|stop}, Default = no state change]</td>
48 <td align="center" valign="middle">no</td>
49 </tr>
50 <tr>
51 <td valign="top">append</td>
52 <td valign="top">Should the recorder append to a file, or create a new
53 one? This is only applicable the first time this task is called for
54 this file. [Values = {yes|no}, Default=no]</td>
55 <td align="center" valign="middle">no</td>
56 </tr>
57 <tr>
58 <td valign="top">emacsmode</td>
59 <td valign="top">Removes <code>[task]</code> banners like Ant's
60 <code>-emacs</code> command line switch if set to
61 <em>true</em>.</td>
62 <td align="center" valign="middle">no, default is <em>false</em></td>
63 </tr>
64 <tr>
65 <td valign="top">loglevel</td>
66 <td valign="top">At what logging level should this recorder instance
67 record to? This is not a once only parameter (like <code>append</code>
68 is) -- you can increase or decrease the logging level as the build process
69 continues. [Values= {error|warn|info|verbose|debug}, Default = no change]
70 </td>
71 <td align="center" valign="middle">no</td>
72 </tr>
73</table>
74
75<h3>Examples</h3>
76<p>The following build.xml snippet is an example of how to use the recorder
77to record just the <code>&lt;javac&gt;</code> task:</p>
78<pre>
79 ...
80 &lt;compile &gt;
81 &lt;record name=&quot;log.txt&quot; action=&quot;start&quot;/&gt;
82 &lt;javac ...
83 &lt;record name=&quot;log.txt&quot; action=&quot;stop&quot;/&gt;
84 &lt;compile/&gt;
85 ...
86</pre>
87
88<p>The following two calls to <code>&lt;record&gt;</code> set up two
89recorders: one to file &quot;records-simple.log&quot; at logging level <code>info</code>
90(the default) and one to file &quot;ISO.log&quot; using logging level of
91<code>verbose</code>.</p>
92<pre>
93 ...
94 &lt;record name=&quot;records-simple.log&quot;/&gt;
95 &lt;record name=&quot;ISO.log&quot; loglevel=&quot;verbose&quot;/&gt;
96 ...
97</pre>
98
99<h3>Notes</h3>
100<p>There is some functionality that I would like to be able to add in the
101future. They include things like the following:</p>
102<table border="1" cellpadding="2" cellspacing="0">
103 <tr>
104 <td valign="top"><b>Attribute</b></td>
105 <td valign="top"><b>Description</b></td>
106 <td align="center" valign="top"><b>Required</b></td>
107 </tr>
108 <tr>
109 <td valign="top">listener</td>
110 <td valign="top">A classname of a build listener to use from this point
111 on instead of the default listener.</td>
112 <td align="center" valign="middle">no</td>
113 </tr>
114 <tr>
115 <td valign="top">includetarget</td>
116 <td valign="top" rowspan=2>A comma-separated list of targets to automatically
117 record. If this value is &quot;all&quot;, then all targets are recorded.
118 [Default = all]</td>
119 <td align="center" valign="middle">no</td>
120 </tr>
121 <tr>
122 <td valign="top">excludetarget</td>
123 <td align="center" valign="middle">no</td>
124 </tr>
125 <tr>
126 <td valign="top">includetask</td>
127 <td valign="top" rowspan=2>A comma-separated list of task to automatically
128 record or not. This could be difficult as it could conflict with the
129 <code>includetarget/excludetarget</code>. (e.g.:
130 <code>includetarget=&quot;compile&quot; exlcudetask=&quot;javac&quot;</code>, what should
131 happen?)</td>
132 <td align="center" valign="middle">no</td>
133 </tr>
134 <tr>
135 <td valign="top">excludetask</td>
136 <td align="center" valign="middle">no</td>
137 </tr>
138 <tr>
139 <td valign="top">action</td>
140 <td valign="top">add greater flexibility to the action attribute. Things
141 like <code>close</code> to close the print stream.</td>
142 <td align="center" valign="top">no</td>
143 </tr>
144 <tr>
145 <td valign="top"></td>
146 <td valign="top"></td>
147 <td align="center" valign="top"></td>
148 </tr>
149</table>
150
151
152
153<hr><p align="center">Copyright &copy; 2001-2004 The Apache Software
154Foundation. All rights Reserved.</p>
155
156</body>
157</html>
Note: See TracBrowser for help on using the repository browser.