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

logutil

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 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 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