/slox

a simple context wrapper around builtin Go slog library.

Primary LanguageGoGNU General Public License v3.0GPL-3.0

slox

push GitHub tag (with filter) codecov Go Report Card GitHub go.mod Go version Go Reference

A simple context wrapper around builtin Go slog library.

Usage

package main

import (
	"context"
	"log/slog"

	"github.com/Vilsol/slox"
)

func main() {
	ctx := context.Background()
	ctx = slox.With(ctx, "foo", "bar")
	ctx = slox.WithGroup(ctx, "my-group")
	ctx = slox.With(ctx, slog.Int("one", 1), "hello", "world")
	slox.Info(ctx, "message")
}