You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

recorder.html 5.5 KiB

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