github go-goyave/goyave v5.3.0
Release v5.3.0

latest releases: v5.4.1, v5.4.0
one month ago

What's Changed

  • Added slog.DiscardLogger(), which redirects logs to io.Discard. (#228 #229)
  • testutil.TestServer now uses the discard logger by default instead of testutil.LogWriter.

This change was made so logs written during tests should usually be silent. To make it more convenient, this is now the default behavior. Sometimes it is still handy to see logs while writing or debugging a test. For this use-case, you can use testutil.LogWriter:

func TestSomething(t *testing.T) {
	opts := goyave.Options{
		Logger: slog.New(slog.NewHandler(true, &testutil.LogWriter{t: t})),
	}
	server := testutil.NewTestServerWithOptions(t, opts)
	//...
}

New Contributors

Full Changelog: v5.2.1...v5.3.0

Don't miss a new goyave release

NewReleases is sending notifications on new releases.