output

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 7 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, formatter OutputFormatter)

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

func SetOutputFormatter

func SetOutputFormatter(option string)

SetOutputFormatter will override default formatter with one of the registered providers

Types

type JSONOutputFormatter

type JSONOutputFormatter struct {
}

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(array 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 {
}

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 {
}

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(array PrintableTable)

Jump to

Keyboard shortcuts

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