log

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Background

func Background() logr.Logger

Background returns the background logger. Current implementation uses klog as the background logger.

func FromContextOrBackground

func FromContextOrBackground(ctx context.Context) logr.Logger

FromContextOrBackground returns a logger from the context if it exists, otherwise it returns a background logger. Current implementation uses klog as the background logger.

func NewContext

func NewContext(ctx context.Context, logger logr.Logger) context.Context

NewContext returns a new context with the provided logger.

func Noop

func Noop() logr.Logger

Noop returns a logger that discards all log messages.

func ValueAsMap

func ValueAsMap(value any) map[string]any

ValueAsMap converts a value to a map[string]any. It returns a map with an "error" key if the conversion fails. NOTE:

It should ONLY be used when the default klog formatter failed to serialize the value in JSON format.
Protobuf messages had implemented `String()` method, which the value is hard to read. Use this method to bypass instead.

Types

This section is empty.

Jump to

Keyboard shortcuts

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