added a hook for the Cause to print a message more cleverly, possibly with ConsoleNotes.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@31887 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2010-06-09 23:24:29 +00:00
1 parent 34430a33cb
commit 4ae0cc7c19
3 files changed
+10 -3

No files matched your search

+8 -1
View File
@@ -28,7 +28,6 @@ import java.util.Arrays;
import java.util.List;
import hudson.diagnosis.OldDataMonitor;
import hudson.model.Queue.*;
import hudson.util.XStream2;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
@@ -62,6 +61,14 @@ public abstract class Cause {
@Exported(visibility=3)
abstract public String getShortDescription();
/**
* Report a line to the listener about this cause.
* @since 1.362
*/
public void print(TaskListener listener) {
listener.getLogger().println(getShortDescription());
}
/**
* Fall back implementation when no other type is available.
* @deprecated since 2009-02-08
@@ -70,7 +70,7 @@ public class StreamBuildListener extends StreamTaskListener implements BuildList
if (causes==null || causes.isEmpty())
l.println("Started");
else for (Cause cause : causes) {
l.println(cause.getShortDescription());
cause.print(this);
}
}
@@ -60,7 +60,7 @@ import java.util.Formatter;
*/
public interface TaskListener extends Serializable {
/**
* This writer will receive the output of the build.
* This writer will receive the output of the build
*
* @return
* must be non-null.