Skip to content

Release v5.3.0

Latest
Compare
Choose a tag to compare
@System-Glitch System-Glitch released this 22 Sep 14:21
· 1 commit to master since this release
3983fc5

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