log

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerbosityFromContext added in v1.1.0

func VerbosityFromContext(ctx context.Context) bool

func WithLogger added in v1.1.0

func WithLogger(ctx context.Context, log Logger) context.Context

func WithVerbosity added in v1.1.0

func WithVerbosity(ctx context.Context, verbose bool) context.Context

Types

type LogLevel

type LogLevel int
const (
	Trace LogLevel = iota
	Debug
	Info
	Warn
	Error
)

type Logger

type Logger interface {
	SetLogLevel(l LogLevel)
	Trace(s string)
	Debug(s string)
	Info(s string)
	Warn(s string)
	Error(e error)
}

func LoggerFromContext added in v1.1.0

func LoggerFromContext(ctx context.Context) Logger

type SpinnerLogger

type SpinnerLogger struct {
	Spinner *spinner.Spinner
	// contains filtered or unexported fields
}

func NewSpinnerLogger added in v1.1.0

func NewSpinnerLogger(spin *spinner.Spinner) *SpinnerLogger

func (*SpinnerLogger) Debug

func (l *SpinnerLogger) Debug(s string)

func (*SpinnerLogger) Error

func (l *SpinnerLogger) Error(e error)

func (*SpinnerLogger) Info

func (l *SpinnerLogger) Info(s string)

func (*SpinnerLogger) SetLogLevel

func (l *SpinnerLogger) SetLogLevel(level LogLevel)

func (*SpinnerLogger) Trace

func (l *SpinnerLogger) Trace(s string)

func (*SpinnerLogger) Warn

func (l *SpinnerLogger) Warn(s string)

type StdoutLogger

type StdoutLogger struct {
	LogLevel LogLevel
}

func (*StdoutLogger) Debug

func (l *StdoutLogger) Debug(s string)

func (*StdoutLogger) Error

func (l *StdoutLogger) Error(e error)

func (*StdoutLogger) Info

func (l *StdoutLogger) Info(s string)

func (*StdoutLogger) SetLogLevel

func (l *StdoutLogger) SetLogLevel(level LogLevel)

func (*StdoutLogger) Trace

func (l *StdoutLogger) Trace(s string)

func (*StdoutLogger) Warn

func (l *StdoutLogger) Warn(s string)

Jump to

Keyboard shortcuts

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