public interface TaskListener extends Serializable
This interface is implemented by Hudson core and passed to extension points so that they can record the progress of the operation without really knowing how those information and handled/stored by Hudson.
The information is one way or the other made available to users, and
so the expectation is that when something goes wrong, enough information
shall be written to a TaskListener
so that the user can diagnose
what's going wrong.
StreamTaskListener
is the most typical implementation of this interface.
All the TaskListener
implementations passed to plugins from Hudson core are remotable.
AbstractTaskListener
Modifier and Type | Field and Description |
---|---|
static TaskListener |
NULL
TaskListener that discards the output. |
Modifier and Type | Method and Description |
---|---|
void |
annotate(ConsoleNote ann)
Annotates the current position in the output log by using the given annotation.
|
PrintWriter |
error(String msg)
An error in the build.
|
PrintWriter |
error(String format,
Object... args)
Formatter#format(String, Object[]) version of error(String) . |
PrintWriter |
fatalError(String msg)
A fatal error in the build.
|
PrintWriter |
fatalError(String format,
Object... args)
Formatter#format(String, Object[]) version of fatalError(String) . |
PrintStream |
getLogger()
This writer will receive the output of the build
|
void |
hyperlink(String url,
String text)
Places a
HyperlinkNote on the given text. |
static final TaskListener NULL
TaskListener
that discards the output.PrintStream getLogger()
void annotate(ConsoleNote ann) throws IOException
IOException
void hyperlink(String url, String text) throws IOException
HyperlinkNote
on the given text.url
- If this starts with '/', it's interpreted as a path within the context path.IOException
PrintWriter error(String msg)
PrintWriter error(String format, Object... args)
Formatter#format(String, Object[])
version of error(String)
.PrintWriter fatalError(String msg)
PrintWriter fatalError(String format, Object... args)
Formatter#format(String, Object[])
version of fatalError(String)
.Copyright © 2017. All rights reserved.