I am submitting (for everyone's pleasure) a new task, called <recorder>.
The recorder task allows a user to state a log file inside the build.xml file. Feature of the recorder are setting (and modifying on the fly) the logging level to record, and manual starting and stopping of the recording. I consider this to be of 0.5 level. In other words, the basic core functionality works and is tested, but I want feedback from users on all aspects of functionality: core and future possibilities. There are two new classes to go into the ant.taskdef package (Recorder.java and RecorderEntry.java), and a new document to go into the manual/coretasks (recorder.html). The defaults.properties in the taskdef directory also needs to be modified (to add the new task) and according to CVS, the diff is: cvs diff defaults.properties (in directory D:\ant\cvs\jakarta-ant\src\main\org\apache\tools\ant\taskdefs\) Index: defaults.properties =================================================================== RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/defaults. properties,v retrieving revision 1.64 diff -r1.64 defaults.properties 45a46 > recorder=org.apache.tools.ant.taskdefs.Recorder So, please use this task and send me feedback on how useful it is, what could work better, what features you want in the future, etc. Jay PS <rant> You know, I'm surprised that no one has added a diff target to ant's build.xml source version that goes through the entire CVS tree looking for things that have been modified, performs diffs on all these files and records them to a log file. This way, coders simply need to do a "build diff" command to see a capturing of all their work. Then, the submitters can simply do a "build patch" command (the patch target would also need to be created) to update CVS. Of course, this is just me spouting off of the top of my head - I haven't' thought of any of the implementation details, or possible pitfalls. Wouldn't such targets be deemed useful? </rant> -- Jay Dickon Glanville P068 - SiteManager Development, Nortel Networks 613-765-1144 (ESN 395-1144) MS: 045/55/A05 E-Mail: [EMAIL PROTECTED] <<recorder.html>> <<Recorder.java>> <<RecorderEntry.java>>Title: Ant User Manual
Recorder
Description
A recorder is a listener to the current build process that records the output to a file.
Several recorders can exist at the same time. Each recorder is associated with a file. The filename is used as a unique identifier for the recorders. The first call to the recorder task with an unused filename will create a recorder (using the parameters provided) and add it to the listeners of the build. All subsiquent calls to the recorder task using this filename will modify that recorders state (recording or not) or other properties (like logging level).
Parameters
| Attribute | Description | Required |
| file | The name of the file this logger is associated with. | yes |
| action | This tells the logger what to do: should it start recording or stop? The first time that the recorder task is called for this logfile, and if this attribute is not provided, then the default for this attribute is "start". If this attribute is not provided on subsiquest calls, then the state remains as previous. [Values = {start|stop}, Default = no state change] | no |
| append | Should the recorder append to a file, or create a new one? This is only applicable the first time this task is called for this file. [Vaules = {yes|no}, Default=yes] | no |
| loglevel | At what logging level should this recorder instance
record to? This is not a once only parameter (like append
is) -- you can increase or decrease the logging level as the build process
continues. [Vaules= {error|warn|info|verbose|debug}, Default = no change]
|
no |
Examples
The following build.xml snippit is an example of how to use the recorder
to record just the <javac> task:
...
<compile >
<recorder file="log.txt" action="" />
<javac ...
<recorder file="log.txt" action="" />
<compile/>
...
The following two calls to <recorder> set up two
recorders: one to file "records-simple.log" at logging level info
(the default) and one to file "ISO.log" using logging level of
verbose.
...
<recorder file="records-simple.log" />
<recorder file="ISO.log" loglevel="verbose" />
...
Notes
There is some funtionality that I would like to be able to add in the future. They include things like the following:
| Attribute | Description | Required |
| messageprefix | Whether or not to include the message prefixes (things
like the name of the tasks or targets, etc). This has the same effect as
the -emacs command line parameter does to the screen output.
[yes|no] |
no |
| listener | A classname of a build listener to use from this point on instead of the default listener. | no |
| includetarget | A coma-separated list of targets to automaticly record. If this value is "all", then all targets are recorded. [Default = all] | no |
| excludetarget | no | |
| includetask | A coma-separated list of task to automaticly
record or not. This could be difficult as it could conflict with the
includetarget/excludetarget. (e.g.:
includetarget="compile" exlcudetask="javac", what should
happen?) |
no |
| excludetask | no | |
Copyright © 2000,2001 Apache Software Foundation. All rights Reserved.
Recorder.java
Description: Binary data
RecorderEntry.java
Description: Binary data
