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
IOException
public StreamTaskListener(File out, Charset charset) throws IOException
IOException
public 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.NULL
IOException
public static StreamTaskListener fromStdout()
public static StreamTaskListener fromStderr()
public PrintStream getLogger()
TaskListener
getLogger
in interface TaskListener
public PrintWriter error(String msg)
TaskListener
error
in interface TaskListener
public PrintWriter error(String format, Object... args)
TaskListener
Formatter#format(String, Object[])
version of TaskListener.error(String)
.error
in interface TaskListener
public PrintWriter fatalError(String msg)
TaskListener
fatalError
in interface TaskListener
public PrintWriter fatalError(String format, Object... args)
TaskListener
Formatter#format(String, Object[])
version of TaskListener.fatalError(String)
.fatalError
in interface TaskListener
public void annotate(ConsoleNote ann) throws IOException
TaskListener
annotate
in interface TaskListener
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void closeQuietly()
Copyright © 2016. All rights reserved.