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,
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)
|
PrintWriter |
fatalError(String msg)
A fatal error in the build.
|
PrintWriter |
fatalError(String format,
Object... args)
|
static StreamTaskListener |
fromStderr() |
static StreamTaskListener |
fromStdout() |
PrintStream |
getLogger()
This writer will receive the output of the build
|
hyperlink
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(Writer w) throws IOException
IOException
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
error
in interface TaskListener
public PrintWriter fatalError(String msg)
TaskListener
fatalError
in interface TaskListener
public PrintWriter fatalError(String format, Object... args)
TaskListener
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 © 2014. All rights reserved.