logcontext

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddContextValue

func AddContextValue(ctx context.Context, key string, value interface{}) context.Context

AddContextValue adds a key value pair to the logging context. If none is defined it will be added.

func New

func New(ctx context.Context, delegate logr.Logger) logr.Logger

New creates a new context logger that delegates the actual requests to the delegate but injects the context log values.

Types

type ContextValues

type ContextValues map[string]interface{}

ContextValues describes the context values.

func FromContext

func FromContext(ctx context.Context) *ContextValues

FromContext returns the context values of a ctx. If nothing is defined nil is returned.

func NewContext

func NewContext(parent context.Context) (context.Context, *ContextValues)

Jump to

Keyboard shortcuts

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