ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <ddevie...@gmail.com>
Subject Re: I think the answer to this question is no
Date Mon, 18 Jan 2010 22:05:52 GMT
On Sun, Jan 17, 2010 at 11:30 PM, Mitch Gitman <mgitman@gmail.com> wrote:
> Is there any programmatic mechanism within Ant to arbitrarily query what the
> current log level is? [...]
>
> What I'd like to do is invoke getProject().log("Some message",
> Project.MSG_VERBOSE) only if the current log level is verbose.

No indeed. The reason being that Ant doesn't keep track of the
"highest" log level for the Logger or the Listeners, because these
guys don't declare whether the "max" level they are interested in. the
-verbose or -debug you pass in the CLI is used by the one Logger, but
there can be other Listener instances that want to get debug messages
even though the Logger does not care about those. There is therefore
no way to avoid generating those strings and sending out these logging
events, despite potentially no one wanting them. Would be a valuable
addition IMHO, but since for BC reasons you'd have to "default" the
max_log_level arg added to Project.addListener(), code that doesn't
use the new API would push the project's max log level to the debug
anway. See what I mean? I'm not sure what I wrote is very clear I'm
afraid. --DD

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


Mime
View raw message