component-basek8s.io/component-base/logs/registry Index | Files

package registry

import "k8s.io/component-base/logs/registry"

Index

Variables

var LogRegistry = NewLogFormatRegistry()

LogRegistry is new init LogFormatRegistry struct

Types

type LogFormatFactory

type LogFormatFactory interface {
	// Create returns a logger with the requested configuration.
	// Returning a flush function for the logger is optional.
	// If provided, the caller must ensure that it is called
	// periodically (if desired) and at program exit.
	Create(options config.FormatOptions) (log logr.Logger, flush func())
}

LogFormatFactory provides support for a certain additional, non-default log format.

type LogFormatRegistry

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

LogFormatRegistry store klog format registry

func NewLogFormatRegistry

func NewLogFormatRegistry() *LogFormatRegistry

NewLogFormatRegistry return new init LogFormatRegistry struct

func (*LogFormatRegistry) Delete

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

Delete specified log format logger

func (*LogFormatRegistry) Freeze

func (lfr *LogFormatRegistry) Freeze()

Freeze freezes the log format registry

func (*LogFormatRegistry) Get

func (lfr *LogFormatRegistry) Get(name string) (LogFormatFactory, error)

Get specified log format logger

func (*LogFormatRegistry) List

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

List names of registered log formats (sorted)

func (*LogFormatRegistry) Register

func (lfr *LogFormatRegistry) Register(name string, factory LogFormatFactory) error

Register new log format registry to global logRegistry. nil is valid and selects the default klog output.

func (*LogFormatRegistry) Set

func (lfr *LogFormatRegistry) Set(name string, factory LogFormatFactory) error

Set specified log format logger

Source Files

registry.go

Version
v0.23.3-rc.0
Published
Jan 19, 2022
Platform
js/wasm
Imports
4 packages
Last checked
3 minutes ago

Tools for package owners.