ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: Advice on modifying the logging output
Date Mon, 18 Dec 2000 04:58:55 GMT
At 08:51  17/12/00 -0800, Diane Holt wrote:
>Can someone who's more familiar with how the default logging output is
>done tell me whether it'd be feasible to only have targets that are
>actually running tasks print out, instead of having the target name always
>print? That is, instead of getting:

try the following. Something like it should work


protected String m_taskName;

public void taskStarted(BuildEvent event)
{
  m_taskName = event.getTask().getName();
}

public void taskFinished(BuildEvent event)
{
  m_taskName = null;
}

public void messageLogged(BuildEvent event)
{
 if( null != m_taskName )
 {
    output( "[" + m_taskName + "]\n" );
    m_taskName = null;
 }
 output( event.getMessage() );
}

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


Mime
View raw message