termio

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package termio centralizes terminal and log-file output helpers used by the eval_mcp_surfaces CLI so commands can write progress to a tee'd destination (stdout plus an optional log file) with a consistent format.

The package owns the process-wide Output sink, the Configure hook that installs the sink at startup, and the Printf/Print/LogPrintf helpers that route through it. Tests can swap the sink with SetOutputForTest to observe output without touching the real filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(logPath string, printOutput bool) (func() error, error)

Configure creates a terminal log at logPath and routes command output to it.

func LogPrintf

func LogPrintf(format string, args ...any)

LogPrintf writes formatted output only to the terminal log sink.

func Print

func Print(content string)

Print writes command output to the configured terminal sink.

func Printf

func Printf(format string, args ...any)

Printf writes formatted command output to the configured terminal sink.

func SetOutputForTest

func SetOutputForTest(out Output) func()

SetOutputForTest replaces the package output sink and returns a restore function.

func ShouldConfigure

func ShouldConfigure(terminalLog string, printOutput, checkDocs bool, checkEfficiencyCount, compareTraceCount int) bool

ShouldConfigure reports whether command output should be routed to a log file.

Types

type Output

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

Output mirrors command progress to an optional log file and stdout.

func NewOutput

func NewOutput(file io.Writer, echo bool) Output

NewOutput creates an output sink for tests or custom terminal routing.

func (Output) Write

func (out Output) Write(p []byte) (int, error)

Write writes p to the configured file sink and optionally to stdout.

Jump to

Keyboard shortcuts

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