logr

package
v0.0.0-...-26d83ff Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContextOrGlobal

func FromContextOrGlobal(ctx context.Context) logr.Logger

FromContextOrGlobal returns a logr.Logger from the given context or the global logger

func GetEncoding

func GetEncoding() string

GetEncoding returns the log encoding; "console" or "json". (default: console)

func GetLogLevel

func GetLogLevel() (zap.AtomicLevel, string, error)

GetLogLevel returns the zap log level and the kubernetes verbosity level

func LoftLogLevel

func LoftLogLevel() string

LoftLogLevel returns the log level; "debug", "info", "warn", "error", "dpanic", "panic", "fatal". (default: info)

func LogFullCallerPath

func LogFullCallerPath() bool

LogFullCallerPath returns true if the full caller path should be logged

func NewLogger deprecated

func NewLogger(component string) (logr.Logger, error)

NewLogger creates a new logr.Logger and sets it as configuration for other global logger packages.

Deprecated: Use NewLoggerWithOptions instead.

func NewLoggerWithOptions

func NewLoggerWithOptions(opts ...Option) (logr.Logger, error)

NewLoggerWithOptions creates a new logr.Logger

func SetGlobalKlog

func SetGlobalKlog(logger logr.Logger, kubernetesVerbosityLevel string) error

SetGlobalKlog sets the global klog logger

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithComponentName

func WithComponentName(name string) Option

func WithDevelopment

func WithDevelopment(inDevelopment bool) Option

func WithDisableStacktrace

func WithDisableStacktrace(disableStacktrace bool) Option

func WithGlobalKlog

func WithGlobalKlog(global bool) Option

func WithGlobalZap

func WithGlobalZap(global bool) Option

func WithLogEncoding

func WithLogEncoding(logEncoding string) Option

func WithLogFullCallerPath

func WithLogFullCallerPath(logFullCallerPath bool) Option

func WithLogLevel

func WithLogLevel(logLevel string) Option

func WithOptionsFromEnv

func WithOptionsFromEnv() Option

Directories

Path Synopsis
Package zapr defines an implementation of the github.com/go-logr/logr interfaces built on top of Zap (go.uber.org/zap).
Package zapr defines an implementation of the github.com/go-logr/logr interfaces built on top of Zap (go.uber.org/zap).

Jump to

Keyboard shortcuts

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