ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
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.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message