logger

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter struct {
	// TimestampFormat - default: time.StampMilli = "Jan _2 15:04:05.000"
	TimestampFormat string
	// NoColors - disable colors
	NoColors bool
	// ShowLevel - when the level < this field, it won't be show. default: TRACE
	ShowLevel logrus.Level
	// ShowFullLevel - show a full level [WARNING] instead of [WARN]
	ShowFullLevel bool
	// NoUppercaseLevel - no upper case for level value
	NoUppercaseLevel bool
	// HideKeys - show [fieldValue] instead of [fieldKey:fieldValue]
	HideKeys bool
	// FieldsDisplayWithOrder - default: all fields display and sorted alphabetically
	FieldsDisplayWithOrder []string
	// CallerFirst - print caller info first
	CallerFirst bool
	// CustomCallerFormatter - set custom formatter for caller info
	CustomCallerFormatter func(*runtime.Frame) string
}

func (*Formatter) Format

func (f *Formatter) Format(entry *logrus.Entry) ([]byte, error)

type KubeKeyLog

type KubeKeyLog struct {
	logrus.FieldLogger
	OutputPath string
	Verbose    bool
}
var Log *KubeKeyLog

func NewLogger

func NewLogger(outputPath string, verbose bool) *KubeKeyLog

func (*KubeKeyLog) Message

func (k *KubeKeyLog) Message(node, str string)

func (*KubeKeyLog) Messagef

func (k *KubeKeyLog) Messagef(node, format string, args ...interface{})

Jump to

Keyboard shortcuts

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