You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering whether there is a bug in the converter.go as per:
/go/pkg/mod/github.com/samber/slog-sentry@v0.1.1/converter.go:28:15: cannot use func(attr slog.Attr) {…} (value of type func(attr slog.Attr)) as func(slog.Attr) bool value in argument to record.Attrs
To reproduce
funcmain() {
err:=sentry.Init(sentry.ClientOptions{
Dsn: "my dsn",
// Debug: true,// Set TracesSampleRate to 1.0 to capture 100%// of transactions for performance monitoring.// We recommend adjusting this value in production,TracesSampleRate: 1.0,
})
iferr!=nil {
log.Fatal(fmt.Sprintf("cannot initialise sentry %s", err))
}
handler:=slogsentry.Option(slogsentry.Option{Level: slog.LevelInfo}).NewSentryHandler()
logger:=slog.New(handler)
logger=logger.
With("environment", "dev").
With("release", "v1.0.0")
slog.SetDefault(logger)
slog.Error("slog error", "key", "value")
}
OS: MacOs 11.7.3
GO version: go version go1.20.3 darwin/amd64
Any thoughts?
Thank you!
The text was updated successfully, but these errors were encountered:
mariocoski
changed the title
func(slog.Attr) bool value in argument to record.Attrs
bug: func(slog.Attr) bool value in argument to record.Attrs
Apr 23, 2023
Hello Samber!
Thank you for your package, great docs!
I was wondering whether there is a bug in the converter.go as per:
/go/pkg/mod/github.com/samber/slog-sentry@v0.1.1/converter.go:28:15: cannot use func(attr slog.Attr) {…} (value of type func(attr slog.Attr)) as func(slog.Attr) bool value in argument to record.Attrs
To reproduce
OS: MacOs 11.7.3
GO version: go version go1.20.3 darwin/amd64
Any thoughts?
Thank you!
The text was updated successfully, but these errors were encountered: