Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 1005 Bytes

README.md

File metadata and controls

24 lines (18 loc) · 1005 Bytes

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")
}