You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2004/07/29 14:03:07 UTC

DO NOT REPLY [Bug 30380] New: - shutdown hook for xmllogger

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