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: invoking the logger in the constructor
Date Mon, 17 Oct 2005 07:08:54 GMT
>The reason seem to be (but I haven't been able to confirm as I 
>have been busy in other matters) that the Task has a default 
>constructor (that I use). To use the 'log()' method, I'd need 
>to invoke a constructor with the node name I want to use.

Task [1] is an abstract class not providing a constructor. Same for
ProjectComponent [2].



>Smthg like :
>  public MyTask()
>  {
>    super("com.cpy_name.pckg.MyTask");

This super-constructor does not exist. Only a   super(projectReference).



>If that is the case, the constructor could use the following 
>definition :
>logger = Logger.getLogger(this.getClass());

Seems like Log4J syntax.
We dont use Log4J (directly). Logging inside Ant is done via its own
logging methods - implemented
in Project [3].
Task implements a log method which delegates to project. Project
delegates to all registered Loggers
and Listeners. A Log4J-Listener is one possibility ... but standard is
simply STDOUT.


Jan

[1]
http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools
/ant/Task.java
[2]
http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools
/ant/ProjectComponent.java
[3]
http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools
/ant/Project.java

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


Mime
View raw message