ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wascally Wabbit" <wascallywab...@earthling.net>
Subject Re: Home grown Ant tasks
Date Thu, 18 Sep 2003 04:15:27 GMT
The Ant website contains a listing of all the available Ant
extensions and tools at http://ant.apache.org/external.html
Lots of good stuff...

Personally I work with the AntXtras package which contains
a set of logging tasks that work with Jakarta Log4J by default
(it also includes source to use J2SE 1.4's logging classes).

An AntXtra-based example to do what you requested might 
look like:

  <emitconfigure noiselevel="info">
     ...
     <emit message="An info level message"/>
     
     <emitconfigure noiselevel="debug">
         ...
         <emit message="A debug level message"/>
         ...
         <emit level="error" message="An error level message!"/>
         ...
     </emitconfigure>
      ...
     <emit message="after the more"/>
  </emitconfigure>
 
Where all <emit>s within the inner <emitconfigure> will broadcast
to any log4j appenders using the "debug" level by default unless
explicit marked with its own level. Everything within the outer
<emitconfigure> is broadcast with the "info" level by default.

The timing features might be accomplished using the export task.
For debugging I usually do something like: 

    <export name="duration_" op="now"/>
    
    [do the thing(s) being timed here]
    
    <export name="duration_" op="-now" copyproperty="duration"/>
    <echo message="**The duration: ${duration}"/>

Note: You need to have Log4J configured to send your logged 
information to the console, a file, a database, or whatever.
Logj is hosted at http://jakarta.apache.org/log4j.

- The Wabbit



----- Original Message -----
From: "Donald Strong" <dstrong@agentissoftware.com>
Date: Thu, 18 Sep 2003 09:55:50 +1000
To: "Ant Users List" <user@ant.apache.org>
Subject: Home grown Ant tasks

> 
> Hi all,
> 
> I know there is a list of ant tasks submitted by ant-users but I can't recall
> where it is. Can someone give me the URL please? (Not ant-contrib)
> 
> In particular I am after a logging task that can be configured within the 
> build.xml to increase logging for particular sections of the build.
> Kind of like "be verbose, but only for this bit". The ability to do
> timings into the log would also be useful.
> 
> I guess I am after a profiler logger that can be configured by calling
> tasks withing the build.xml.
> 
> Any suggestions?
> 
> Thanks in advance,
> Donald.

-- 
__________________________________________________________
Sign-up for your own personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message