Documentation
¶
Overview ¶
Package output provides tree-structured rendering for DAG execution status.
Index ¶
Constants ¶
const ( TreeBranch = "├─" // Branch with siblings below TreeLastBranch = "└─" // Last branch (no siblings below) TreePipe = "│ " // Vertical continuation line TreeSpace = " " // Empty space (no vertical line needed) )
Tree drawing characters using Unicode box-drawing characters.
const DefaultMaxOutputLines = 50
DefaultMaxOutputLines is the default number of lines to show for stdout/stderr. Only the last N lines are shown (tail) when output exceeds this limit.
const DefaultMaxWidth = 80
DefaultMaxWidth is the maximum line width before wrapping.
Variables ¶
This section is empty.
Functions ¶
func ReadLogFileTail ¶
ReadLogFileTail reads the last N lines from a log file. It returns:
- lines: the actual log lines (tail portion if truncated)
- truncated: number of lines that were truncated from the beginning
- err: any error encountered while reading
If maxLines is 0 or negative, all lines are returned. If the file doesn't exist or is empty, returns nil, 0, nil. Binary files are detected and return ["(binary data)"], 0, nil. Files larger than 10MB are skipped to prevent memory exhaustion.
func StatusText ¶
StatusText returns human-readable status text for a DAG status.
Types ¶
type Config ¶
type Config struct {
// ColorEnabled enables colored output using ANSI escape codes.
// Should be auto-detected based on terminal capability.
ColorEnabled bool
// ShowStdout enables display of stdout content in the tree.
ShowStdout bool
// ShowStderr enables display of stderr content in the tree.
ShowStderr bool
// MaxOutputLines limits stdout/stderr to last N lines (tail).
// Set to 0 for unlimited output.
MaxOutputLines int
// MaxWidth is the maximum line width before wrapping.
// Set to 0 for no wrapping.
MaxWidth int
}
Config holds configuration for tree rendering.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default configuration with sensible defaults.
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer renders DAG execution status as a tree structure.
func NewRenderer ¶
NewRenderer creates a new tree renderer with the given configuration.
func (*Renderer) RenderDAGStatus ¶
RenderDAGStatus renders the complete DAG status as a pipelight-style tree. The output format is:
● Running - 2024-01-15 16:52:58
dag: my_dag (6s 619ms)
├─step: build (4s)
│ ├─echo hello
│ │ ├─stdout: hello
│ │ └─stderr:
│ └─result: ✓
└─step: test (2s)
└─npm test
├─stdout: All tests passed
└─stderr: