RoadmapShopEvents
Skip to main content

Home > @rushstack/terminal > StdioSummarizer

StdioSummarizer class

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Summarizes the results of a failed build task by returning a subset of stderr output not to exceed a specified maximum number of lines.

Signature:

export declare class StdioSummarizer extends TerminalWritable 

Extends: TerminalWritable

Remarks

IMPORTANT: This transform assumes that its input was prepared by StderrLineTransform, so that each ITerminalChunk.text item is a single line terminated by a "\n" character.

The IStdioSummarizerOptions.leadingLines and IStdioSummarizerOptions.trailingLines counts specify the maximum number of lines to be returned. Any additional lines will be omitted. For example, if leadingLines and trailingLines were set to 3, then the summary of 16 stderr lines might look like this:

Line 1
Line 2
Line 3
...10 lines omitted...
Line 14
Line 15
Line 16

If the stderr output is completely empty, then the stdout output will be summarized instead.

Constructors

ConstructorModifiersDescription
(constructor)(options)(BETA) Constructs a new instance of the StdioSummarizer class

Properties

PropertyModifiersTypeDescription
isOpenreadonlyboolean

This property is initially true when the object is constructed, and becomes false when close() is called.

(Inherited from TerminalWritable)

preventAutoclosereadonlyboolean(Inherited from TerminalWritable)

Methods

MethodModifiersDescription
close()

Calling this method flushes any remaining outputs and permanently transitions the TerminalWritable to a "closed" state, where no further chunks can be written.

(Inherited from TerminalWritable)

getReport()(BETA) Returns the summary report.
onClose()protected

Subclasses can override this empty method to perform additional operations such as closing a file handle.

(Inherited from TerminalWritable)

onWriteChunk(chunk)(BETA)
writeChunk(chunk)

Upstream objects call this method to provide inputs to this object.

(Inherited from TerminalWritable)