output

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLevel VerboseLevel = iota - 1
	InfoLevel
	WarnLevel
	ErrorLevel
	PanicLevel

	MinLevel     = DebugLevel
	MaxLevel     = PanicLevel
	DefaultLevel = int(MaxLevel)
)

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(level int) logr.Logger

func RegisterOutputFormatter

func RegisterOutputFormatter(option string, factory func(io.Writer) OutputFormatter)

RegisterOutputFormatter registers a formatter factory under the specific option. E.g. "json" for JsonFormatter

func SetOutputFormatter

func SetOutputFormatter(option string, w io.Writer)

SetOutputFormatter will override default formatter with one of the registered providers

Types

type JSONOutputFormatter

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

func (*JSONOutputFormatter) Error

func (f *JSONOutputFormatter) Error(err error, message string)

func (*JSONOutputFormatter) Print

func (f *JSONOutputFormatter) Print(message string)

func (*JSONOutputFormatter) PrintObject

func (f *JSONOutputFormatter) PrintObject(object any)

func (*JSONOutputFormatter) PrintTable

func (f *JSONOutputFormatter) PrintTable(table PrintableTable)

type OutputFormatter

type OutputFormatter interface {
	Print(message string)
	Error(err error, message string)
	PrintObject(object any)
	PrintTable(array PrintableTable)
}
var (
	Formatter OutputFormatter
)

type PrintableTable

type PrintableTable struct {
	Headers []string
	Data    [][]string
}

type TextOutputFormatter

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

func (*TextOutputFormatter) Error

func (f *TextOutputFormatter) Error(err error, message string)

func (*TextOutputFormatter) Print

func (f *TextOutputFormatter) Print(message string)

func (*TextOutputFormatter) PrintObject

func (f *TextOutputFormatter) PrintObject(object any)

func (*TextOutputFormatter) PrintTable

func (f *TextOutputFormatter) PrintTable(table PrintableTable)

type VerboseLevel

type VerboseLevel int8

type YAMLOutputFormatter

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

func (*YAMLOutputFormatter) Error

func (f *YAMLOutputFormatter) Error(err error, message string)

func (*YAMLOutputFormatter) Print

func (f *YAMLOutputFormatter) Print(message string)

func (*YAMLOutputFormatter) PrintObject

func (f *YAMLOutputFormatter) PrintObject(object any)

func (*YAMLOutputFormatter) PrintTable

func (f *YAMLOutputFormatter) PrintTable(table PrintableTable)

Jump to

Keyboard shortcuts

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