Have you tried 2>&1 redirection?

- Alexey.

On 8/9/06, Paul Hammant <[EMAIL PROTECTED]> wrote:


To code it in org.apache.tools.ant.DefaultLogger, add ...

  + " @ " + formatTime(System.currentTimeMillis() - startTime)

... to the msg being prepared.  Like so ....

    public void targetStarted(BuildEvent event) {
        if (Project.MSG_INFO <= msgOutputLevel
            && !event.getTarget().getName().equals("")) {
            String msg = StringUtils.LINE_SEP
                + event.getTarget().getName() + " @ " + formatTime(
System.currentTimeMillis() - startTime) + ":";
            printMessage(msg, out, event.getPriority());
            log(msg);
        }
    }

Works sweetly, but we don't want to maintain a forked Ant.

The other solution for us was to launch ant like so :

  ant -verbose -listener
org.apache.tools.ant.listener.CommonsLoggingListener >&ant-output.txt

The redirection '>&' is out and err to the same log file. That only works
on Unix. On Windows the >ant-output.txt 2>ant-output.txt causes teh
process handelr to barf suggesting the file is already in use.

All we wanted was to work out how long each target was taking, without
switching to an XML logging format..

- Paul


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Alexey N. Solofnenko trelony at gmail.com
home: http://trelony.cjb.net/
Pleasant Hill, CA (GMT-8 hours usually)

Reply via email to