You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mike McNally <m5...@works.com> on 2003/04/01 02:30:47 UTC

simple log level determination

I've got some tools that are wired into ant via separate adapter
classes (that implement Task).  I'd like to keep the tools such that
they're not directly dependent on Ant classes, but I'd also like to
make them smarter when used in Ant.  Specifically, I'd at least like
to be able to turn on and off chatty build-time status messages if
"ant" is running with "-q".

I realize this touches on a lot of fairly complex things going on 
inside the Ant runtime; I'm not looking for anything fancy.  This
seems like it might be a fairly common issue -- is it?

--
[ you are my main foo ] Mike McNally -- m5@works.com

Re: simple log level determination

Posted by Mike McNally <m5...@works.com>.
> But we've encountered it in Axis, I am part way through writing a 
> commons-logging adapter that binds commons-logging data to the ant 
> output levels. So your code uses commons-logging internally, to bind to 
> whatever, and in ant it gets the ant log system

Yea, that's true; I could just modify the tool so that it does all its
progress output via some wrapper object that'd either be a simple wrapper
for "System.out.println" or for the Ant logger.

Problem solved.

--
[ you are my main foo ] Mike McNally -- m5@works.com

Re: simple log level determination

Posted by Steve Loughran <st...@iseran.com>.
Mike McNally wrote:
> I've got some tools that are wired into ant via separate adapter
> classes (that implement Task).  I'd like to keep the tools such that
> they're not directly dependent on Ant classes, but I'd also like to
> make them smarter when used in Ant.  Specifically, I'd at least like
> to be able to turn on and off chatty build-time status messages if
> "ant" is running with "-q".
> 
> I realize this touches on a lot of fairly complex things going on 
> inside the Ant runtime; I'm not looking for anything fancy.  This
> seems like it might be a fairly common issue -- is it?
> 

It isnt that common, most people just link in to ant.

But we've encountered it in Axis, I am part way through writing a 
commons-logging adapter that binds commons-logging data to the ant 
output levels. So your code uses commons-logging internally, to bind to 
whatever, and in ant it gets the ant log system