lib

package
v0.0.0-...-31d25bb Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LogInfo is the info level
	LogInfo = 0
	// LogDebug is the debug level
	LogDebug = 5
	// LogVerbose is an extra level more verbose than Debug
	LogVerbose = 10
)

Following are log severity levels to be used by registered services

Variables

This section is empty.

Functions

func UpdateLogLevel

func UpdateLogLevel(
	d *v1alpha1.LogSetting,
)

UpdateLogLevel updates log severity

Types

type LogSetter

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

LogSetter watches for DebuggingConfiguration and changes log severity at run-time based on that custom resource configuration.

func GetInstance

func GetInstance() *LogSetter

GetInstance returns LogSetter instance

func RegisterForLogSettings

func RegisterForLogSettings(
	ctx context.Context,
	componentNamespace, componentIdentifier string,
	logger logr.Logger,
	config *rest.Config,
) *LogSetter

RegisterForLogSettings will react to LogConfigurations change. Pod service account calling this must have permission to read LogConfigurations. LogConfigurations is the custom resource to be used to uniformly set log level for all component. By calling this method, any change in LogConfigurations.Spec will be processed and log severity set for affected component(s).

func (*LogSetter) SetDebugValue

func (l *LogSetter) SetDebugValue(debugSeverity int)

SetDebugValue sets severity for Debug

func (*LogSetter) SetDefaultValue

func (l *LogSetter) SetDefaultValue(defaultSeverity int)

SetDefaultValue sets default severity

func (*LogSetter) SetInfoValue

func (l *LogSetter) SetInfoValue(infoSeverity int)

SetInfoValue sets severity for Info

func (*LogSetter) SetVerboseValue

func (l *LogSetter) SetVerboseValue(verboseSeverity int)

SetVerboseValue sets severity for Verbose

Jump to

Keyboard shortcuts

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