Documentation
¶
Index ¶
- Constants
- func NewLogger(level int) logr.Logger
- func RegisterOutputFormatter(option string, factory func(io.Writer) OutputFormatter)
- func SetOutputFormatter(option string, w io.Writer)
- type JSONOutputFormatter
- type OutputFormatter
- type PrintableTable
- type TextOutputFormatter
- type VerboseLevel
- type YAMLOutputFormatter
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 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 ¶
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 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)
Click to show internal directories.
Click to hide internal directories.