kubernetes: k8s.io/kubernetes/staging/src/k8s.io/component-base/logs Index | Files | Directories

package logs

import "k8s.io/kubernetes/staging/src/k8s.io/component-base/logs"

Index

Package Files

logs.go options.go registry.go

func AddFlags Uses

func AddFlags(fs *pflag.FlagSet)

AddFlags registers this package's flags on arbitrary FlagSets, such that they point to the same value as the global flags.

func FlushLogs Uses

func FlushLogs()

FlushLogs flushes logs immediately.

func GlogSetter Uses

func GlogSetter(val string) (string, error)

GlogSetter is a setter to set glog level.

func InitLogs Uses

func InitLogs()

InitLogs initializes logs the way we want for kubernetes.

func NewLogger Uses

func NewLogger(prefix string) *log.Logger

NewLogger creates a new log.Logger which sends logs to klog.Info.

type KlogWriter Uses

type KlogWriter struct{}

KlogWriter serves as a bridge between the standard log package and the glog package.

func (KlogWriter) Write Uses

func (writer KlogWriter) Write(data []byte) (n int, err error)

Write implements the io.Writer interface.

type LogFormatRegistry Uses

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

LogFormatRegistry store klog format registry

func NewLogFormatRegistry Uses

func NewLogFormatRegistry() *LogFormatRegistry

NewLogFormatRegistry return new init LogFormatRegistry struct

func (*LogFormatRegistry) Delete Uses

func (lfr *LogFormatRegistry) Delete(name string) error

Delete specified log format logger

func (*LogFormatRegistry) Freeze Uses

func (lfr *LogFormatRegistry) Freeze()

Freeze freezes the log format registry

func (*LogFormatRegistry) Get Uses

func (lfr *LogFormatRegistry) Get(name string) (logr.Logger, error)

Get specified log format logger

func (*LogFormatRegistry) List Uses

func (lfr *LogFormatRegistry) List() []string

List names of registered log formats (sorted)

func (*LogFormatRegistry) Register Uses

func (lfr *LogFormatRegistry) Register(name string, logger logr.Logger) error

Register new log format registry to global logRegistry

func (*LogFormatRegistry) Set Uses

func (lfr *LogFormatRegistry) Set(name string, logger logr.Logger) error

Set specified log format logger

type Options Uses

type Options struct {
    LogFormat string
}

Options has klog format parameters

func NewOptions Uses

func NewOptions() *Options

NewOptions return new klog options

func (*Options) AddFlags Uses

func (o *Options) AddFlags(fs *pflag.FlagSet)

AddFlags add logging-format flag

func (*Options) Apply Uses

func (o *Options) Apply()

Apply set klog logger from LogFormat type

func (*Options) Get Uses

func (o *Options) Get() (logr.Logger, error)

Get logger with LogFormat field

func (*Options) Validate Uses

func (o *Options) Validate() []error

Validate verifies if any unsupported flag is set for non-default logging format

Directories

PathSynopsis
json
logreduction

Package logs imports 11 packages (graph). Updated 2020-09-18. Refresh now. Tools for package owners.