Bug 30380 - shutdown hook for xmllogger
Summary: shutdown hook for xmllogger
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Build Process (show other bugs)
Version: 1.5.4
Hardware: Other other
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-29 12:03 UTC by Erik Romson
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Romson 2004-07-29 12:03:06 UTC
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