Documentation
¶
Overview ¶
node_logs.go extends the tailer with kubelet-proxy log streaming so torque can enrich 'torque logs' sessions with node/system files alongside pod output.
Package tailer implements torque's high-performance, color-aware log streamer used by the 'torque logs' family of commands, coordinating informers, filters, and observer hooks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultColorPalette ¶
DefaultColorPalette returns the vibrant color rotation used when rendering torque log streams.
Types ¶
type LogObserver ¶
type LogObserver interface {
ObserveLog(LogRecord)
}
LogObserver receives callbacks whenever the tailer renders a log line.
type LogRecord ¶
type LogRecord struct {
Timestamp time.Time
FormattedTimestamp string
Namespace string
Pod string
Container string
Raw string
Rendered string
Source string
SourceGlyph string
RenderedEqualsRaw bool
}
LogRecord captures a single log line emitted by the tailer along with contextual metadata.
type Option ¶
type Option func(*Tailer)
Option configures optional Tailer behavior.
func WithJSONFilter ¶
WithJSONFilter sets key-value pairs to filter structured logs.
func WithLogObserver ¶
func WithLogObserver(observer LogObserver) Option
WithLogObserver registers an observer that sees every rendered log line.
func WithOutput ¶
WithOutput overrides the writer used for rendered output.
func WithPodFilter ¶
WithPodFilter registers an optional callback that further restricts which pods are tailed. It is evaluated after name/condition filters.
func WithSelectionObserver ¶
func WithSelectionObserver(observer SelectionObserver) Option
WithSelectionObserver registers an observer that sees active selection changes (pods/containers tailed).
type SelectionObserver ¶
type SelectionObserver interface {
ObserveSelection(SelectionSnapshot)
}
SelectionObserver receives callbacks whenever the tailer changes its active selection.
type SelectionSnapshot ¶
type SelectionSnapshot struct {
Timestamp time.Time `json:"timestamp"`
ChangeKind string `json:"changeKind"`
Reason string `json:"reason,omitempty"`
Namespace string `json:"namespace,omitempty"`
Pod string `json:"pod,omitempty"`
Container string `json:"container,omitempty"`
RestartCount int32 `json:"restartCount,omitempty"`
Selected []SelectionTarget `json:"selected"`
}
SelectionSnapshot captures a change in the set of active log tails.
type SelectionTarget ¶
type Tailer ¶
type Tailer struct {
// contains filtered or unexported fields
}
Tailer coordinates pod discovery via informers and streams logs to stdout.
func New ¶
func New(client kubernetes.Interface, opts *config.Options, logger logr.Logger, tailerOptions ...Option) (*Tailer, error)
New creates a Tailer instance.
func (*Tailer) PruneTails ¶
PruneTails stops any active tails that do not satisfy keep.
func (*Tailer) SetPodDisplayOverride ¶
SetPodDisplayOverride overrides the rendered pod label for the given pod. The override affects only output formatting, not Kubernetes API requests.