autologger

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterceptorLogger

func InterceptorLogger(logger *log.Logger) logging.Logger

InterceptorLogger creates a logging.Logger that automatically extracts Azure headers from the gRPC context. This is the default implementation that uses common.GetFields to extract standard Azure headers like correlation-id, operation-id, request-id, and arm-client-request-id from gRPC metadata.

func InterceptorLoggerWithHeadersFunc added in v0.0.39

func InterceptorLoggerWithHeadersFunc(logger *log.Logger, headersFunc HeadersFunc) logging.Logger

InterceptorLoggerWithHeadersFunc creates a logging.Logger with custom header extraction logic. This provides flexibility to customize which headers are extracted from the context. Pass nil as headersFunc to use the default common.GetFields header extraction.

Types

type HeadersFunc added in v0.0.39

type HeadersFunc func(ctx context.Context) map[string]string

HeadersFunc extracts headers from the context to be added to the logger. It should return a map[string]string containing header key-value pairs.

Jump to

Keyboard shortcuts

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