Interface LogStorage
- All Known Implementing Classes:
BrokenLogStorage,FileLogStorage
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringendStep()Closes an HTML step block.default FilegetLogFile(FlowExecutionOwner.Executable build, boolean complete) Deprecated.nodeListener(FlowNode node) Provides an alternate way of emitting output from a node (such as a step).static LogStorageGets the available log storage method for a given build.Provides an alternate way of emitting output from a build.overallLog(FlowExecutionOwner.Executable build, boolean complete) Provides an alternate way of retrieving output from a build.static StringIntroduces an HTML block with apipeline-node-<ID>CSS class based onFlowNode.getId().Provides an alternate way of retrieving output from a build.static OutputStreamWraps the specifiedOutputStreamwith a buffer that flushes automatically as needed.static BuildListenerWraps the specifiedOutputStreamwith aBuildListenerthat automatically buffers and flushes remote writes.
-
Method Details
-
overallListener
Provides an alternate way of emitting output from a build.May implement
AutoCloseableto clean up at the end of a build; it may or may not be closed during Jenkins shutdown while a build is running.The caller may wrap the result using
TaskListenerDecorator.apply(hudson.model.TaskListener, org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner, org.jenkinsci.plugins.workflow.log.TaskListenerDecorator).- Returns:
- a (remotable) build listener; do not bother overriding anything except
TaskListener.getLogger() - Throws:
IOExceptionInterruptedException- See Also:
-
nodeListener
Provides an alternate way of emitting output from a node (such as a step).May implement
AutoCloseableto clean up at the end of a node (FlowNode.isActive()); it may or may not be closed during Jenkins shutdown while a build is running.The caller may wrap the result using
TaskListenerDecorator.apply(hudson.model.TaskListener, org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner, org.jenkinsci.plugins.workflow.log.TaskListenerDecorator).- Parameters:
node- a running node- Returns:
- a (remotable) task listener; do not bother overriding anything except
TaskListener.getLogger() - Throws:
IOExceptionInterruptedException- See Also:
-
StepContext.get(java.lang.Class<T>)
-
overallLog
@NonNull AnnotatedLargeText<FlowExecutionOwner.Executable> overallLog(@NonNull FlowExecutionOwner.Executable build, boolean complete) Provides an alternate way of retrieving output from a build.In an
AnnotatedLargeText.writeHtmlTo(long, java.io.Writer)override,ConsoleAnnotationOutputStream.eol(byte[], int)should applystartStep(java.lang.String)andendStep()to delineate blocks contributed by steps. (Also seeConsoleAnnotators.)- Parameters:
complete- if true, we claim to be serving the complete log for a build, so implementations should be sure to retrieve final log lines- Returns:
- a log
-
startStep
Introduces an HTML block with apipeline-node-<ID>CSS class based onFlowNode.getId(). -
endStep
Closes an HTML step block. -
stepLog
Provides an alternate way of retrieving output from a build.- Parameters:
node- a running nodecomplete- if true, we claim to be serving the complete log for a node, so implementations should be sure to retrieve final log lines- Returns:
- a log for this just this node
- See Also:
-
getLogFile
@Deprecated @NonNull default File getLogFile(@NonNull FlowExecutionOwner.Executable build, boolean complete) Deprecated.Only used for compatibility withRun.getLogFile().Provide a file containing the log text. The default implementation creates a temporary file based on the current contents ofoverallLog(org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner.Executable, boolean).- Parameters:
build- as inoverallLog(org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner.Executable, boolean)complete- as inoverallLog(org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner.Executable, boolean)- Returns:
- a possibly temporary file
-
of
Gets the available log storage method for a given build.- Parameters:
b- a build about to start- Returns:
- the mechanism for handling this build, including any necessary fallback
- See Also:
-
wrapWithRemoteAutoFlushingListener
@NonNull static BuildListener wrapWithRemoteAutoFlushingListener(@NonNull OutputStream os) throws IOException Wraps the specifiedOutputStreamwith aBuildListenerthat automatically buffers and flushes remote writes.- Throws:
IOException
-
wrapWithAutoFlushingBuffer
@NonNull static OutputStream wrapWithAutoFlushingBuffer(@NonNull OutputStream os) throws IOException Wraps the specifiedOutputStreamwith a buffer that flushes automatically as needed.- Throws:
IOException
-
Run.getLogFile().