2024-01-15 04:45:34 +03:00
|
|
|
// Package lgt provides a mechanism for getting a *slog.Logger
|
2024-01-25 07:01:24 +03:00
|
|
|
// that outputs to testing.T. See lgt.New.
|
2024-01-15 04:45:34 +03:00
|
|
|
package lgt
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
"log/slog"
|
|
|
|
|
|
|
|
"github.com/neilotoole/slogt"
|
|
|
|
|
|
|
|
"github.com/neilotoole/sq/libsq/core/lg/devlog"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() { //nolint:gochecknoinits
|
|
|
|
slogt.Default = slogt.Factory(func(w io.Writer) slog.Handler {
|
|
|
|
return devlog.NewHandler(w, slog.LevelDebug)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-01-25 07:01:24 +03:00
|
|
|
// New delegates to slogt.New.
|
2024-01-15 04:45:34 +03:00
|
|
|
var New = slogt.New
|