Skip to content

phsym/zeroslog

Repository files navigation

zeroslog

Go Reference license Build codecov Go Report Card

A zerolog handler for slog

Example

package main

import (
	"log/slog"
	"github.com/phsym/zeroslog"
)

func main() {
	logger := slog.New(
        zeroslog.NewJsonHandler(os.Stderr, &zeroslog.HandlerOptions{Level: slog.LevelDebug}),
    )
	slog.SetDefault(logger)
    slog.Info("Hello world!", "foo", "bar")
}

About

A zerolog handler for slog

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages