logging

package
v0.0.1-alpha.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, opts ...Option) context.Context

NewContext derives a new LoggingContext from the existing LoggingContext, adds the provided annotations, and then returns a clone of the provided context.Context with the new LoggingContext. IMPORTANT: The provided context is not modified, logging annotations are only part of the new context.

func UpdateContext

func UpdateContext(ctx context.Context, opts ...Option)

UpdateContext updates the existing logging context in the context. IMPORTANT: No new context is created, all future logs with provided context will be impacted.

Types

type Option

type Option func(c zerolog.Context) zerolog.Context

Option allows to annotate logs with metadata.

func WithRequestID

func WithRequestID(reqID string) Option

WithRequestID can be used to annotate logs with the request id.

Jump to

Keyboard shortcuts

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