Interface OutputStreamTaskListener
- All Superinterfaces:
Serializable
,org.jenkinsci.remoting.SerializableOnlyOverRemoting
,TaskListener
- All Known Implementing Classes:
OutputStreamTaskListener.Default
@Restricted(org.kohsuke.accmod.restrictions.Beta.class)
public interface OutputStreamTaskListener
extends TaskListener
TaskListener
which can directly return an OutputStream
not wrapped in a PrintStream
.
This is important for logging since the error-swallowing behavior of PrintStream
is unwanted,
and PrintStream.checkError()
is useless.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Convenience implementation handlingOutputStreamTaskListener.Default.getLogger()
. -
Field Summary
Fields inherited from interface hudson.model.TaskListener
NULL
-
Method Summary
Modifier and TypeMethodDescriptionReturns theOutputStream
from whichTaskListener.getLogger()
was constructed.static OutputStream
getOutputStream
(TaskListener listener) Tries to callgetOutputStream()
and otherwise falls back to reflective access toFilterOutputStream.out
when possible, at worst returning thePrintStream
itself.Methods inherited from interface org.jenkinsci.remoting.SerializableOnlyOverRemoting
getChannelForSerialization
Methods inherited from interface hudson.model.TaskListener
annotate, error, error, fatalError, fatalError, getCharset, getLogger, hyperlink
-
Method Details
-
getOutputStream
Returns theOutputStream
from whichTaskListener.getLogger()
was constructed. -
getOutputStream
Tries to callgetOutputStream()
and otherwise falls back to reflective access toFilterOutputStream.out
when possible, at worst returning thePrintStream
itself.
-