You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Vladimir Egorov <ve...@bea.com> on 2007/03/06 21:04:43 UTC
how to get Project' message output level
Hi Ant Users,
Project defines MSG_ERR, MSG_WARN, etc. codes. Is there a programmatic
way to get current message output level (log level)? I suppose this
would come from the flag (-verbose, -debug, etc.) that user passed on
command line.
I am extending the AntContrib' AntServer/RemoteAnt tasks. I would like
to get the log level in client project and pass it to server project, so
that server project can log at the same log level as client.
I am using Ant 1.6.5.
Thank you,
--Vladimir
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: how to get Project' message output level
Posted by Vladimir Egorov <ve...@bea.com>.
Dominique,
Thank you for your explanation. Something is still strange here, as
indeed, only the default logger gets to know the user-specified log
level (Main.createLogger()).
I am also looking at Ant task and I see that for the called project, the
logger is set to MSG_INFO level, regardless of what user specified. I
will go with the same approach for my remote Ant call.
Thank you again,
--Vladimir
> -----Original Message-----
> From: Dominique Devienne [mailto:ddevienne@gmail.com]
> Sent: Tuesday, March 06, 2007 1:20 PM
> To: Ant Users List
> Subject: Re: how to get Project' message output level
>
> On 3/6/07, Vladimir Egorov <ve...@bea.com> wrote:
> > Project defines MSG_ERR, MSG_WARN, etc. codes. Is there a
programmatic
> > way to get current message output level (log level)? I suppose this
> > would come from the flag (-verbose, -debug, etc.) that user passed
on
> > command line.
>
> There is no "current" log level in Ant. The CLI flags set the log
> level for the "Default" logger, but other listeners can (and often do)
> use a different level. For example, the XML listener by default logs
> all messages, at any levels. Since loggers/listeners don't tell Ant at
> what level they are currently operating, Ant does not know what's the
> max (or min) log level in effect at any one time. So no, it cannot be
> done. Sorry, --DD
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: how to get Project' message output level
Posted by Dominique Devienne <dd...@gmail.com>.
On 3/6/07, Vladimir Egorov <ve...@bea.com> wrote:
> Project defines MSG_ERR, MSG_WARN, etc. codes. Is there a programmatic
> way to get current message output level (log level)? I suppose this
> would come from the flag (-verbose, -debug, etc.) that user passed on
> command line.
There is no "current" log level in Ant. The CLI flags set the log
level for the "Default" logger, but other listeners can (and often do)
use a different level. For example, the XML listener by default logs
all messages, at any levels. Since loggers/listeners don't tell Ant at
what level they are currently operating, Ant does not know what's the
max (or min) log level in effect at any one time. So no, it cannot be
done. Sorry, --DD
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org