logs

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TailContainerCrashLogs added in v0.25.0

func TailContainerCrashLogs(runtime, containerName string, lines int)

TailContainerCrashLogs fetches the last N lines from a crashed container and prints them in a styled error box for immediate developer context.

func TailHostCrashLogs added in v0.25.0

func TailHostCrashLogs(serviceName string, lines int)

TailHostCrashLogs reads the last N lines from a host process log file and prints them in a styled error box.

Types

type LogLine

type LogLine struct {
	Timestamp time.Time `json:"timestamp"`
	Service   string    `json:"service"`
	Message   string    `json:"message"`
	Type      string    `json:"type"` // "container" or "host"
}

type Model

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

func InitialModel

func InitialModel() Model

func InitialModelWithRedactor added in v0.25.0

func InitialModelWithRedactor(r *SecretRedactor) Model

InitialModelWithRedactor creates the TUI model with secret redaction enabled. All log lines will be scrubbed for known secret values before display.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type SecretRedactor added in v0.25.0

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

SecretRedactor replaces known secret values in log output with a redaction marker. Because devx centrally loads all secrets via vault/env integration, it can perform exact-match replacement rather than relying on pattern-based heuristics.

func NewSecretRedactor added in v0.25.0

func NewSecretRedactor() *SecretRedactor

NewSecretRedactor builds a redactor from the current environment. It collects all env-var values and filters out obviously non-sensitive short values (length <= 3) and common system paths to avoid false positives.

func NewSecretRedactorFromPairs added in v0.25.0

func NewSecretRedactorFromPairs(pairs []string) *SecretRedactor

NewSecretRedactorFromPairs builds a redactor from explicit KEY=VALUE pairs. Useful for testing or when secrets come from a vault loader rather than the process environment.

func (*SecretRedactor) Redact added in v0.25.0

func (r *SecretRedactor) Redact(s string) string

Redact replaces all known secret values in the input string.

type Streamer

type Streamer struct {
	Lines    chan LogLine
	Errors   chan error
	Redactor *SecretRedactor
	// contains filtered or unexported fields
}

func NewStreamer

func NewStreamer() *Streamer

func (*Streamer) Start

func (s *Streamer) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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