Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 6552 invoked by uid 500); 13 Mar 2001 13:05:55 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 6542 invoked from network); 13 Mar 2001 13:05:54 -0000 Message-ID: <6DDA62170439D31185750000F80826AC057A48EF@zmerd004.ca.nortel.com> From: "Jay Glanville" To: "Ant-User (text)" Subject: Requesting feedback on a task: recorder Date: Tue, 13 Mar 2001 08:01:19 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C0ABBD.B209F6E0" X-Orig: X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C0ABBD.B209F6E0 Content-Type: text/plain; charset="ISO-8859-1" I've already posted this to the ant-dev distribution list, so if any of you animals live in both dens, feel free to ignore. ;-) I've found the logging functionality in ant 1.3 doesn't satisfy all my needs. I need to be able to record just a single target, or to turn the logging off so that I can mail the log file to the loadbuild administrator, or to be able to set the logfile's name within the build.xml file itself (I'd like the filename to use the values from the task). So, with necessity being the mother of invention, I'm feeling some maternal instinct coming on. (Or would that be paternal? Oh well!) I'm thinking of creating a new task, called recorder. It's purpose is to allow control of the logging within the build.xml file itself. Functionality would include things like: - being able to log just a subset of targets - starting and stopping the logging at will - logging to multiple files What I'm asking for is feedback from the user community. Would you find such a task useful? Is there logging functionality that currently isn't in Ant1.3 that you'd hope this would address? Is the task and attribute names appropriate? Etc., etc., etc. ... you get the idea. I have attached an Ant-like document that describes how to use to this e-mail. Thanks in advance JDG <> -- Jay Dickon Glanville P068 - SiteManager Development, Nortel Networks 613-765-1144 (ESN 395-1144) MS: 045/55/A05 E-Mail: dickon@nortelnetworks.com ------_=_NextPart_000_01C0ABBD.B209F6E0 Content-Type: text/html; name="recorder.html" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="recorder.html" Ant User Manual

Recorder

Description

A recorder is a listener to the current build process that records = the output to a file. =20

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 modify that recorders state or properties.

The recorder's state (on or off), is modifiable explicity through = the action attribute, or automaticly through the includetarget / excludetarget attributes. When ant enters = a target that is in a recorder's include list and the recorder's state is "on", then the recorder will send all output from this target to the logfile. If the state of the recorder was off when entering an = included target, then no records will be logged. (Include/exclude rule = resolution: record all targets that are in the include list, and not in the exclude list.)

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. [start|stop] no
includetarget A coma-separated list of targets to automaticly record. If this value is "all", then all targets are recorded. [Default =3D all] no
excludetarget A coma-separated list of targets to automaticly record. [Default =3D none] no
append Should the recorder append to a file, or create = a new one? [yes|no] no

Examples

The following build.xml snippit is an example of how to use the = recorder to record just the <javac> task:

    ...
    <target name=3D"compile" >
        <recorder file=3D"log.txt" action=3D"start" />
        <javac ...
        <recorder file=3D"log.txt" action=3D"stop" />
    </target>
    ...

The following snippit does the same thing, but records the output = for the compile target:

    ...
    <recorder file=3D"log.txt" includetarget=3D"compile" />
    <target name=3D"compile" ...
    ...

Example 3:

    ...
    <recorder file=3D"log.txt" action=3D"stop" =
includetarget=3D"compile" />
    ...
    <recorder file=3D"log.txt" excludetarget=3D"document" />
    ...

For the above example, the first call to = <recorder> sets up the logfile, tells it what to record, but does not start the recording. The second call to <recorder> changes = what to record (to not record the document target), but the = state (stopped) does not change.

The following two calls to <recorder> set up two recorders: one to file "records.log" (this records everything from this point on, possibly to be used for ISO reproducability records) and = another to file "notify.log" (this just records the results of the compile = target, to be e-mailed as notification on the success/fail of the compile).

    ...
    <recorder file=3D"records.log" />
    <recorder file=3D"notify.log" includetarget=3D"compile" />
    ...

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
verbosity Allows the modification of the current verbosity = level recorded. no
listener A classname of a build listener to use from this = point on instead of the default listener. 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=3D"compile" exlcudetask=3D"javac", what = should happen?) no
excludetask no


Copyright © 2000,2001 Apache Software = Foundation. All rights Reserved.

------_=_NextPart_000_01C0ABBD.B209F6E0--