Help us shape the future of Go! Take the 2026 Go Developer Survey

logger

package
v0.110.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(log logr.Logger, message string, err error, additionalFields map[string]interface{})

Error logs an error message with optional additional fields.

func Info

func Info(log logr.Logger, message string, additionalFields map[string]interface{})

Info logs an informational message with optional additional fields.

func LogEndpointExtractionError

func LogEndpointExtractionError(
	log logr.Logger,
	resourceType, resourceNamespace, resourceName, endpointType, key string,
	err error,
) error

LogEndpointExtractionError logs an error when extracting an endpoint from a secret or similar resource.

func NewSlogLogger added in v0.10.0

func NewSlogLogger(l *slog.Logger) logr.Logger

NewSlogLogger returns a logr.Logger backed by the provided slog.Logger minLogLevel follows logr convention: 0=info, -1=debug, etc.

func NewSlogLoggerWithLevel added in v0.10.0

func NewSlogLoggerWithLevel(l *slog.Logger, minLogLevel int) logr.Logger

NewSlogLoggerWithLevel returns a logr.Logger backed by the provided slog.Logger with custom log level minLogLevel follows logr convention: 0=info, -1=debug, etc.

func WithHeartbeat

func WithHeartbeat(ctx context.Context, component string, namespace, name string) logr.Logger

WithHeartbeat creates a logger with heartbeat context

func WithRequest

func WithRequest(ctx context.Context, component string, namespace, name string) logr.Logger

WithRequest creates a logger with request context (namespace and name)

Types

This section is empty.

Jump to

Keyboard shortcuts

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