output

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package output provides terminal output formatting and coloring.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OutputWriter

type OutputWriter struct {
	// contains filtered or unexported fields
}

OutputWriter handles terminal output with colors and filtering.

func NewOutputWriter

func NewOutputWriter(w io.Writer, noColor bool, muteContainers []string, jsonMode ...bool) *OutputWriter

NewOutputWriter creates a new output writer. noColor disables colors. noColorEnv respects NO_COLOR environment variable per https://no-color.org

func (*OutputWriter) WriteJSON

func (ow *OutputWriter) WriteJSON(line docker.LogLine) error

WriteJSON writes a log line in JSON format. Respects --mute for containers that shouldn't be displayed.

func (*OutputWriter) WriteLogLine

func (ow *OutputWriter) WriteLogLine(line docker.LogLine)

WriteLogLine writes a formatted log line to terminal. In JSON mode, outputs structured JSONL. Otherwise, human-readable with colors. Respects --mute for containers that shouldn't be displayed.

type ParsedLogLine

type ParsedLogLine struct {
	Timestamp     string
	ContainerName string
	Stream        string
	Content       string
}

ParseLogLine is a helper for testing; parses a simple log line. Used by tests to verify formatting.

func ParseTerminalLine

func ParseTerminalLine(line string) (ParsedLogLine, error)

ParseTerminalLine parses a terminal output line back to components (for testing).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL