Re: Can DefaultLogger record the time on each target transition?
Jeffrey, In addition to backwards compatibility, there are other issues to consider: 1) Granularity: why limit timing data to targets? why not extend it to tasks as well? Personally, I'm not interested in timing tasks. Perhaps that could be debated another time. 2) Filtering: do you want timing data for every target? every task? As above. I'm interested for this (closing) discussion to consider target only, not task. Also, this proposal is asking for the a "time since start of build" not "total time taken for target, start to finish". Specifically, the time when the target starts, not the time when the target ends. and the big one 3) Multithreading: as the committers on this list will tell you, I'm always thinking about this one. At IBM, we use Ant + in-house antlibs to build the WebSphere family of products. We're fortunate to have very good hardware in our build lab, and with products as large as WebSphere we're keen on making the most efficient use of it; one of the ways we do that is to multithread our builds. In our initial experiments we wanted to get timing data to compare against our single-threaded builds, so we wrote our own custom logger (just slight changes to the default logger) to print the timings. When we ran the builds, everything went haywire. I see how multithreading would affect a strategy to collect timings. Again though I'm asking for something else. --- I think however I I'll let this drop now. There's enough weight of opinion against the change for it to obviously futile to carry on. No consensus is emerging. Have fun, - Paul
Re: Can DefaultLogger record the time on each target transition?
Without any cited cases I am prepared to believe that someone is programatically processing default log output in such a way that it would break if it found one of.. compile @ 1 minute 12 seconds: compile (1 minute 12 seconds): compile: (at 1 minute 12 seconds) .. and that it would be too much for that team to fix their application to accommodate the new info. Perhaps an ant.exe command line switch could do it ( -timedTargets ) or an environmental variable ( -DtimedTargets=true ) Bugzilla bug 27771 is in the same realm too - http:// issues.apache.org/bugzilla/show_bug.cgi?id=27771 and hints that an additional temporal element to the Default Logger output would be problematic. - Paul On Aug 14, 2006, at 4:58 AM, Jeffrey E Care wrote: I wouldn't make the assumption that ALL automated log analyzers use the XML format. __ __ Jeffrey E. (Jeff) Care [EMAIL PROTECTED] IBM WebSphere Application Server Development WAS Pyxis Lead Release Engineer "Paul Hammant" <[EMAIL PROTECTED]> wrote on 08/11/2006 04:34:21 PM: > > Alexey, > > > This one works: dir ham.txt>output.log 2>&1 > > ant [target] >output.log 2>&1 > > .. works well. > > Tis up to you guys to change the DefaultLogger or not. It sure looks > nice when you run it and there's no harm as electronic processors of > Ant output (like CruiseControl) use the XML logger. > > - Paul > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >
Re: Can DefaultLogger record the time on each target transition?
Alexey, > This one works: dir ham.txt>output.log 2>&1 ant [target] >output.log 2>&1 .. works well. Tis up to you guys to change the DefaultLogger or not. It sure looks nice when you run it and there's no harm as electronic processors of Ant output (like CruiseControl) use the XML logger. - Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can DefaultLogger record the time on each target transition?
Alexey, > Have you tried 2>&1 redirection? Thanks for tip. I've tried it and it has no effect I'm looking for. What is it supposed to do on Windows XP ? dir 2>&1 ham.txt (there's no ham.txt afteward, output was not redirected as hoped) - Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can DefaultLogger record the time on each target transition?
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]