ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30380] New: - shutdown hook for xmllogger
Date Thu, 29 Jul 2004 12:03:07 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30380>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30380

shutdown hook for xmllogger

           Summary: shutdown hook for xmllogger
           Product: Ant
           Version: 1.5.4
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Build Process
        AssignedTo: dev@ant.apache.org
        ReportedBy: erik@zenior.no


Hi,
I'm using CruiseControl for our build process. Sometimes ant hangs for some
reason which is annoying. I'm forced to use the XMLLogger (that is how CC
communicates with ant).
Anyway when Ant hangs I have no log because the xmllogger has finished the build.
I therefore has written a shuttdown hook that finishes the build.
I now have to register it as a task to add it. I do think though that if you
finish the process the xmllogger should flush.

RegisterTask has line
Runtime.getRuntime().addShutdownHook(shutdownObj); 

The shutdown class looks like:

public class BuildLoggerFlushShutdownHook extends Thread 
{
    Project project;
    
    public BuildLoggerFlushShutdownHook(Project project) {
        super();
        this.project=project;
    }

    public void run() {
                BuildEvent buildEvent=new BuildEvent(project);
                buildEvent.setException(new BuildException("The build was
shutdown, this stop was made by the shutdown hook "+
                    this.getClass().getName()));
                listener.buildFinished(buildEvent);
     }
}

That is my suggestion to add something similar if a logger is used that doesn't
flush
Regards
Erik Romson

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


Mime
View raw message