logz

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package logz provides structured JSON logging with trace ID propagation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(level string) *slog.Logger

New creates a structured JSON logger at the given level. Accepted levels are "debug", "info", "warn", "error" (case-insensitive). Unrecognized levels default to "info".

func TraceIDFrom

func TraceIDFrom(ctx context.Context) string

TraceIDFrom retrieves the trace ID from the context. Returns an empty string if no trace ID is present.

func WithTraceID

func WithTraceID(ctx context.Context, traceID string) context.Context

WithTraceID stores a trace ID in the given context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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