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 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 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)
Click to show internal directories.
Click to hide internal directories.