loggerutils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLoggerToCtx

func AddLoggerToCtx(ctx context.Context) context.Context

func ReadValue

func ReadValue(ctx context.Context, key string) string

ReadValue returns the value stored by WithReadableValue for key, or "" if absent. It panics if a value is present but is not a string.

func WithReadableValue

func WithReadableValue(ctx context.Context, key string, value string) context.Context

WithReadableValue adds key/value to the logger (like WithValue) and also stores it on the context so it can be retrieved later with ReadValue.

func WithValue

func WithValue(ctx context.Context, kv ...string) context.Context

WithValue returns a context whose logger carries the given key/value string fields. kv is read in pairs; a trailing unpaired element is ignored.

Types

This section is empty.

Jump to

Keyboard shortcuts

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