提交 16769c0c 编写于 作者: K Kohsuke Kawaguchi

improved the logging so that we can see who's marking the build as a failure

上级 07e84653
......@@ -66,6 +66,7 @@ import javax.servlet.ServletException;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.text.MessageFormat;
import java.util.AbstractSet;
import java.util.ArrayList;
import java.util.Calendar;
......@@ -621,7 +622,10 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
for (BuildStep bs : buildSteps) {
if ((bs instanceof Publisher && ((Publisher)bs).needsToRunAfterFinalized()) ^ phase)
try {
r &= perform(bs,listener);
if (!perform(bs,listener)) {
LOGGER.fine(MessageFormat.format("{0} : {1} failed", AbstractBuild.this.toString(), bs));
r = false;
}
} catch (Exception e) {
String msg = "Publisher " + bs.getClass().getName() + " aborted due to exception";
e.printStackTrace(listener.error(msg));
......@@ -655,8 +659,10 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
protected final boolean preBuild(BuildListener listener,Iterable<? extends BuildStep> steps) {
for (BuildStep bs : steps)
if (!bs.prebuild(AbstractBuild.this,listener))
if (!bs.prebuild(AbstractBuild.this,listener)) {
LOGGER.fine(MessageFormat.format("{0} : {1} failed", AbstractBuild.this.toString(), bs));
return false;
}
return true;
}
}
......
......@@ -31,10 +31,12 @@ import hudson.tasks.Notifier;
import java.io.File;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.List;
import java.util.logging.Logger;
import static hudson.model.Result.ABORTED;
import static hudson.model.Result.FAILURE;
......@@ -172,9 +174,13 @@ public abstract class Build <P extends Project<P,B>,B extends Build<P,B>>
private boolean build(BuildListener listener, Collection<Builder> steps) throws IOException, InterruptedException {
for( BuildStep bs : steps )
if(!perform(bs,listener))
if(!perform(bs,listener)) {
LOGGER.fine(MessageFormat.format("{0} : {1} failed", Build.this.toString(), bs));
return false;
}
return true;
}
}
private static final Logger LOGGER = Logger.getLogger(Build.class.getName());
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册