Categorygithub.com/MottoStreaming/ctxslog.go
modulepackage
0.0.0-20240423211541-8cce29b5e132
Repository: https://github.com/mottostreaming/ctxslog.go.git
Documentation: pkg.go.dev

# README

ctxslog

PkgGoDev

This package provides a context value slog.Logger. You can use it to log messages with a request scoped logger that can be extended by additional attributes.

# Functions

AddArgs adds attributes to the context logger.
Debug is equivalent to calling Debug on the logger in the context.
Error is equivalent to calling Error on the logger in the context.
Extract returns the context-scoped Logger.
Info is equivalent to calling Info on the logger in the context.
ToContext adds the slog.Logger to the context for extraction later.
Warn is equivalent to calling Warn on the logger in the context.