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 Fri, 14 Oct 2005 09:33:35 GMT
>> 
>> public class MyCustomTask extends Task {
>>     public MyCustomTask ()
>>     {
>>          System.out.println("Instanciated");
>>     }
>> }
>> 
>
>regarding the exception in the constructor; send a stack trace.
>
>
>Ant tasks normally use the log() operations, with different 
>levels of verbosity
>
>log("your files have been deleted",Project.MSG_VERBOSE); 
>log("unstable condition in the antimatter core",Project.MSG_ERROR);


For the ability to log the class needs a reference to the project instance.
IMHO inside the constructor there is no reference - it´s set via inherited
setProject() method (MyCustomTask --|> Task --|> ProjectComponent) AFTER
instantiation.

Jan

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


Mime
View raw message