# OutputCollectors.jl Documentation

This is the reference documentation of OutputCollectors.jl.

## Types

OutputCollectors.OutputCollectorType
OutputCollector

A run() wrapper class that captures subprocess stdout and stderr streams independently, resynthesizing and colorizing the streams appropriately.

source
OutputCollectors.OutputCollectorMethod
OutputCollector(cmd::AbstractCmd; verbose::Bool = false)

Run cmd, and collect the output such that stdout and stderr are captured independently, but with the time of each line recorded such that they can be stored/analyzed independently, but replayed synchronously.

source
OutputCollectors.LineStreamMethod
LineStream(pipe::Pipe)

Given a Pipe that has been initialized by spawn(), create an async Task to read in lines as they come in and annotate the time the line was captured for later replay/merging with other simultaneously captured streams.

source

## Functions

Base.mergeMethod
merge(collector::OutputCollector; colored::Bool = false)

Merge the stdout and stderr streams of the OutputCollector on a per-line basis, returning a single string containing all collected lines, interleaved by capture time. If colored is set to true, embeds terminal color codes to print stderr in red.

source
OutputCollectors.tailMethod
tail(collector::OutputCollector; len::Int = 100, colored::Bool = false)

Write out the last len lines, optionally writing colored lines.

source
OutputCollectors.teeMethod
tee(c::OutputCollector; colored::Bool = false, stream::IO = stdout)

Spawn a background task to incrementally output lines from collector to the standard output, optionally colored.

source
Base.waitMethod
wait(collector::OutputCollector)

Wait for the command and all line streams within an OutputCollector to finish their respective tasks and be ready for full merging. Return the success of the underlying process. Prints out the last 10 lines of the process if it does not complete successfully unless the OutputCollector was created as verbose.

source
OutputCollectors.aliveMethod
alive(s::LineStream)

Returns true if the task owned by this LineStream is still processing output from an underlying Pipe.

source
OutputCollectors.readuntil_manyMethod
readuntil_many(s::IO, delims)

Given a collection of delimiter characters, read from s until one of those delimiters is reached, or we reach the end of s.

source