logutil

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package logutil ties a structured zap logger to a context.Context so handlers thread the same logger without explicit arguments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextField

func ContextField(name string) zap.Field

ContextField returns a zap field for a kubeconfig context name.

func ErrorField

func ErrorField(err error) zap.Field

ErrorField returns a zap field for an error value.

func UnwrapLogger

func UnwrapLogger(ctx context.Context) *zap.Logger

UnwrapLogger retrieves the zap logger from the context. Returns a no-op logger when none is present.

func WrapLogger

func WrapLogger(ctx context.Context, log *zap.Logger) context.Context

WrapLogger stores a zap logger in the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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