stdctx

package
v0.0.148 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package stdctx provides functions for putting and getting context values that we use commonly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

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

Log returns a logger from the context or panics if none is available.

func Logger

func Logger(ctx context.Context) (*zap.Logger, bool)

Logger requires the calling code to behave differently if the logger is not present.

func MaybeLog

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

MaybeLog returns a logger from the context, or a nop logger if it's not present.

func WithLogger

func WithLogger(ctx context.Context, logs *zap.Logger) context.Context

WithLogger add a zap logger to 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