logbox

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogBox

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

LogBox renders a scrolling box in a terminal for outputting logs without filling up the whole scrollback. On the first line it shows the waitMessage with a spinner in front.

func New

func New(height int, waitMessage string, interrupt chan bool) LogBox

New initializes a LogBox. The interrupt channel will be written to on ctrl+c/ctrl+d since it intercepts these.

func (LogBox) Init

func (lb LogBox) Init() tea.Cmd

func (LogBox) Update

func (lb LogBox) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (LogBox) View

func (lb LogBox) View() string

type Msg

type Msg struct {
	Line string
	Done bool
}

func (Msg) String

func (r Msg) String() string

type Output

type Output struct {
	*tea.Program
}

Output implements output.LogOutput to send log lines to the tea.Program.

func (*Output) FormatAndPrintln

func (f *Output) FormatAndPrintln(ts time.Time, lbls loghttp.LabelSet, maxLabelsLen int, line string)

func (*Output) WithWriter

func (f *Output) WithWriter(w io.Writer) output.LogOutput

Jump to

Keyboard shortcuts

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