registry

package
v0.25.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogRegistry = NewLogFormatRegistry()

LogRegistry is new init LogFormatRegistry struct

Functions

This section is empty.

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(c config.LoggingConfiguration) (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

Jump to

Keyboard shortcuts

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