sshlog

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSHLogger

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

func NewSshLogger

func NewSshLogger() *SSHLogger

NewSshLogger constructs a new ssh logger

func (*SSHLogger) TeaHandler

func (sshl *SSHLogger) TeaHandler(s ssh.Session) (tea.Model, []tea.ProgramOption)

You can wire any Bubble Tea model up to the middleware with a function that handles the incoming ssh.Session. Here we just grab the terminal info and pass it to the new model. You can also return tea.ProgramOptions (such as tea.WithAltScreen) on a session by session basis.

func (*SSHLogger) WithConnectProgram

func (sshl *SSHLogger) WithConnectProgram() func(*tea.Program)

WithConnectProgram generates a tea ProgramOption that hooks the program into the SSH logger.

func (*SSHLogger) Write

func (sshl *SSHLogger) Write(p []byte) (n int, err error)

func (*SSHLogger) WriteLevel

func (sshl *SSHLogger) WriteLevel(level zerolog.Level, p []byte) (n int, err error)

type Styles

type Styles struct {
	// Timestamp is the style for timestamps.
	Timestamp lipgloss.Style

	// Caller is the style for source caller.
	Caller lipgloss.Style

	// Prefix is the style for prefix.
	Prefix lipgloss.Style

	// Message is the style for messages.
	Message lipgloss.Style

	// Key is the style for keys.
	Key lipgloss.Style

	// Value is the style for values.
	Value lipgloss.Style

	// Separator is the style for separators.
	Separator lipgloss.Style

	// Levels are the styles for each level.
	Levels map[zerolog.Level]lipgloss.Style

	// Keys overrides styles for specific keys.
	Keys map[string]lipgloss.Style

	// Values overrides value styles for specific keys.
	Values map[string]lipgloss.Style
}

Styles defines the styles for the text logger.

func DefaultStyles

func DefaultStyles() *Styles

DefaultStyles returns the default styles.

Jump to

Keyboard shortcuts

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