Skip to content
/ slox Public

a simple context wrapper around builtin Go slog library.

License

Notifications You must be signed in to change notification settings

Vilsol/slox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slox

push GitHub release (latest SemVer) codecov CodeFactor 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")
}

About

a simple context wrapper around builtin Go slog library.

Resources

License

Stars

Watchers

Forks

Languages