ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@mad.scientist.com
Subject Task Names vs Class Names ?
Date Wed, 12 Jul 2000 07:13:53 GMT

Hi,

would it be possible to log the name that the task is given
in buildfile rather than the name of class. Ie currently if
taskdef defines fred as FredTheImpl the logger will output 

[FredTheImpl] saids something

rather than

[fred] saids something

This would also be useful when you are creating tasks to do
work in other tasks. (ie I am delegating a lot of tasks to
underlying exec). So instead of outputing

mytask:
[Exec] some output.

I could output

mytask:
[mytask] some output.

To do this all that is needed is to add accessor/mutator for
name property in Task class. Then change part in
Project.createTask to read

    if( o instanceof Task ) {
               task=(Task)o;
               task.setName( taskType ); //added line ....
            } else {

Then change the log to do 
event.getTask().getName()

instead of 

event.getTask().getClass().getName()

Cheers,

Pete

*--------------------------------------------------*
| Latrobe University,     |                        |
| Bundoora, Australia     | Does the name 'Pavlov' |
| Office: PW220           |    ring a bell ?       |
| Ex: 2503                |                        |
*--------------------------------------------------*


Mime
View raw message