Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 25820 invoked from network); 7 Jun 2002 21:11:24 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 Jun 2002 21:11:24 -0000 Received: (qmail 2379 invoked by uid 97); 7 Jun 2002 21:11:26 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 2327 invoked by uid 97); 7 Jun 2002 21:11:25 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 2274 invoked by uid 98); 7 Jun 2002 21:11:25 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: <98D21B073202584C9125C860580DC4EDEC044F@lgchexch006.ad.lgc.com> From: Dominique Devienne To: "'Ant Developers List'" Subject: RE: Subelements and logging Date: Fri, 7 Jun 2002 16:11:13 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N You could always use JDK 1.4 logging (java.util.logging) everywhere, and have a handler which is Ant aware, and redirects the messages to the Ant logging sub-system. But of course, that would tie the code to JDK 1.4! PS: By the way, anyone using JDK 1.4 might be interested to know JDK 1.4.0_01 is out, and fixes important bugs, notably two that affected debugging of threaded applications. -----Original Message----- From: Kyle Adams [mailto:kadams@gfs.com] Sent: Friday, June 07, 2002 4:05 PM To: ant-dev@jakarta.apache.org Subject: Re: Subelements and logging Hmm... this just gets curiouser and curiouser... Background - I'm cleaning up the XmlTask that the Ant web site links to on the External Tools and Tasks page. Previously, various classes in XmlTask output messages using System.out.println(). I'd like to change this so that the messages are proper log messages. After getting feedback, I went back into the code and found all the instances of System.out.println() - turns out that it's not subelements that are outputting the messages, but utility classes used by the Task itself, during the execute(). Unfortunately, passing in a reference of the Task to these utility classes would be a bit messy, so I think I may try the ProjectComponent subclass or ant.util.TaskLogger route. Kyle >>> jakarta-ant@ehatchersolutions.com 06/07/02 03:32PM >>> It depends on when you want logging to occur. During configuration/population? Or after your execute() method is invoked? If during configuration and using addConfiguredXXX then extending from ProjectComponent seems like a good solution. If during execute then there are other tricks you could employ, like having a method on your tsk that logs and pass a reference of your task to the sub-elements to call - or something like that. Erik ----- Original Message ----- From: "Kyle Adams" To: Sent: Friday, June 07, 2002 3:15 PM Subject: Re: Subelements and logging If I wasn't using the addConfiguredXXXX methods, I could pass the task into the constructor, but since that route won't work for me, I'm guessing I'll have to be dependent on Ant classes. Does this sound correct to you guys? Kyle >>> jakarta-ant@ehatchersolutions.com 06/07/02 03:01PM >>> Nevermind.... this trick doesn't apply to sub-elements, only to tasks. Stefan's suggestion is the way to have direct easy access to Ant's logging capabilities in sub-elements. My preference would be to use a different pattern such that sub-elements have no dependency on Ant classes or API's at all - and develop a way for your task and sub-elements to communicate with one another for logging. Erik -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: