ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: identifying current logging level in custom task
Date Thu, 08 Jul 2004 05:14:47 GMT
No ... not yet.

The loglevel is evaluatet in Main. The Main only sets the loglevel on the
registered
logger:

772:    private BuildLogger createLogger() {
793:        logger.setMessageOutputLevel(msgOutputLevel);

But I don┬┤t know whether we shouldnt provide a way to get that info. 
The danger is that task writers will write code like
   if (project.getLoglevel()==Project.MSG_DEBUG) ...
instead of 
   log(..., Project.MSG_DEBUG);
In the later case Ant will do the right redirection.


Jan



> -----Urspr├╝ngliche Nachricht-----
> Von: Jeffrey Bacon [mailto:jbacon@magmic.com]
> Gesendet am: Mittwoch, 7. Juli 2004 18:01
> An: Ant Users List
> Betreff: identifying current logging level in custom task
> 
> Is there any way for a custom task to determine what the 
> current logging 
> level for the project is at?  For example, when I pass 
> '-verbose' on the 
> command line and Ant goes into verbose logging level, can I identify 
> that situation and then print out logging info if I am in that level?
> 
> no, printing to log(msg, Project.MSG_VERBOSE) doesn't do what 
> I want as 
> I want to tell command that I execute from within the task whether to 
> output verbose info or not.
> -- 
> --
> Jeffrey Bacon
> jbacon@magmic.com
> Creative Developer
> http://www.magmic.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message