package xslog

import "git.sr.ht/~jamesponddotco/xstd-go/xlog/xslog"

Package xslog provides extensions to the standard structured logging module of the Go standard library.

Index

Functions

func LogEvent

func LogEvent(ctx context.Context, logger *slog.Logger, level slog.Level, msg string, attrs ...slog.Attr)

LogEvent is a wrapper around slog.Logger.LogAttrs that only logs if logger isn't nil. It exists primarily to reduce the amount of ifs in the code.

Source Files

xslog.go

Version
v0.13.1 (latest)
Published
Jan 29, 2025
Platform
linux/amd64
Imports
2 packages
Last checked
4 days ago

Tools for package owners.