logging

package
v0.2.13-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrSection

func ErrSection(err error) fmt.Stringer

func Log

func Log(ctx context.Context, operation Operation, status Status, obj client.Object, color *color.Color, args ...fmt.Stringer)

func Section

func Section(name string, args ...any) fmt.Stringer

func WithLogger

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

func WithSink

func WithSink(ctx context.Context, sink Sink) context.Context

Types

type Logger

type Logger interface {
	Log(context.Context, Operation, Status, client.Object, *color.Color, ...fmt.Stringer)
}

type LoggerFunc

type LoggerFunc func(context.Context, Operation, Status, client.Object, *color.Color, ...fmt.Stringer)

func NewLogger

func NewLogger(test string, step string) LoggerFunc

func (LoggerFunc) Log

func (f LoggerFunc) Log(ctx context.Context, operation Operation, status Status, obj client.Object, color *color.Color, args ...fmt.Stringer)

type Operation

type Operation string
const (
	Apply    Operation = "APPLY"
	Assert   Operation = "ASSERT"
	Catch    Operation = "CATCH"
	Cleanup  Operation = "CLEANUP"
	Command  Operation = "CMD"
	Create   Operation = "CREATE"
	Delete   Operation = "DELETE"
	Error    Operation = "ERROR"
	Finally  Operation = "FINALLY"
	Get      Operation = "GET"
	Internal Operation = "INTERNAL"
	Patch    Operation = "PATCH"
	Script   Operation = "SCRIPT"
	Sleep    Operation = "SLEEP"
	Stderr   Operation = "STDERR"
	Stdout   Operation = "STDOUT"
	Try      Operation = "TRY"
	Update   Operation = "UPDATE"
)

type Sink

type Sink interface {
	Log(string, string, Operation, Status, client.Object, *color.Color, ...fmt.Stringer)
}

type SinkFunc

type SinkFunc func(string, string, Operation, Status, client.Object, *color.Color, ...fmt.Stringer)

func (SinkFunc) Log

func (f SinkFunc) Log(test string, step string, operation Operation, status Status, obj client.Object, color *color.Color, args ...fmt.Stringer)

type Status

type Status string
const (
	BeginStatus   Status = "BEGIN"
	DoneStatus    Status = "DONE"
	EndStatus     Status = "END"
	ErrorStatus   Status = "ERROR"
	LogStatus     Status = "LOG"
	OkStatus      Status = "OK"
	RunStatus     Status = "RUN"
	SkippedStatus Status = "SKIP"
	WarnStatus    Status = "WARN"
)

Jump to

Keyboard shortcuts

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