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 anOutputStream
not wrapped in aPrintStream
. This is important for logging since the error-swallowing behavior ofPrintStream
is unwanted, andPrintStream.checkError()
is useless.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
OutputStreamTaskListener.Default
Convenience implementation handlingOutputStreamTaskListener.Default.getLogger()
.
-
Field Summary
-
Fields inherited from interface hudson.model.TaskListener
NULL
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description OutputStream
getOutputStream()
Returns 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
_error, annotate, error, error, fatalError, fatalError, getCharset, getLogger, hyperlink
-
-
-
-
Method Detail
-
getOutputStream
@NonNull OutputStream getOutputStream()
Returns theOutputStream
from whichTaskListener.getLogger()
was constructed.
-
getOutputStream
@NonNull static OutputStream getOutputStream(@NonNull TaskListener listener)
Tries to callgetOutputStream()
and otherwise falls back to reflective access toFilterOutputStream.out
when possible, at worst returning thePrintStream
itself.
-
-