public class StreamTaskListener extends AbstractTaskListener implements Serializable, Closeable
TaskListener that generates output into a single stream.
This object is remotable.
NULL| Constructor and Description |
|---|
StreamTaskListener()
Deprecated.
as of 1.349
Use
TaskListener.NULL |
StreamTaskListener(File out) |
StreamTaskListener(File out,
boolean append,
Charset charset)
Constructs a
StreamTaskListener that sends the output to a specified file. |
StreamTaskListener(File out,
Charset charset) |
StreamTaskListener(OutputStream out) |
StreamTaskListener(OutputStream out,
Charset charset) |
StreamTaskListener(PrintStream out)
Deprecated.
as of 1.349
The caller should use
StreamTaskListener(OutputStream, Charset) to pass in
the charset and output stream separately, so that this class can handle encoding correctly,
or use fromStdout() or fromStderr(). |
StreamTaskListener(Writer w) |
| Modifier and Type | Method and Description |
|---|---|
void |
annotate(ConsoleNote ann)
Annotates the current position in the output log by using the given annotation.
|
void |
close() |
void |
closeQuietly()
Closes this listener and swallows any exceptions, if raised.
|
PrintWriter |
error(String msg)
An error in the build.
|
PrintWriter |
error(String format,
Object... args)
Formatter#format(String, Object[]) version of TaskListener.error(String). |
PrintWriter |
fatalError(String msg)
A fatal error in the build.
|
PrintWriter |
fatalError(String format,
Object... args)
Formatter#format(String, Object[]) version of TaskListener.fatalError(String). |
static StreamTaskListener |
fromStderr() |
static StreamTaskListener |
fromStdout() |
PrintStream |
getLogger()
This writer will receive the output of the build
|
hyperlink@Deprecated public StreamTaskListener(PrintStream out)
StreamTaskListener(OutputStream, Charset) to pass in
the charset and output stream separately, so that this class can handle encoding correctly,
or use fromStdout() or fromStderr().public StreamTaskListener(OutputStream out)
public StreamTaskListener(OutputStream out, Charset charset)
public StreamTaskListener(File out) throws IOException
IOExceptionpublic StreamTaskListener(File out, Charset charset) throws IOException
IOExceptionpublic StreamTaskListener(File out, boolean append, Charset charset) throws IOException
StreamTaskListener that sends the output to a specified file.out - the file.append - if true, then output will be written to the end of the file rather than the beginning.charset - if non-null then the charset to use when writing.IOException - if the file could not be opened.public StreamTaskListener(Writer w) throws IOException
IOException@Deprecated public StreamTaskListener() throws IOException
TaskListener.NULLIOExceptionpublic static StreamTaskListener fromStdout()
public static StreamTaskListener fromStderr()
public PrintStream getLogger()
TaskListenergetLogger in interface TaskListenerpublic PrintWriter error(String msg)
TaskListenererror in interface TaskListenerpublic PrintWriter error(String format, Object... args)
TaskListenerFormatter#format(String, Object[]) version of TaskListener.error(String).error in interface TaskListenerpublic PrintWriter fatalError(String msg)
TaskListenerfatalError in interface TaskListenerpublic PrintWriter fatalError(String format, Object... args)
TaskListenerFormatter#format(String, Object[]) version of TaskListener.fatalError(String).fatalError in interface TaskListenerpublic void annotate(ConsoleNote ann) throws IOException
TaskListenerannotate in interface TaskListenerIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void closeQuietly()
Copyright © 2019. All rights reserved.