Documentation
¶
Index ¶
- Variables
- func ErectRequest(t testing.TB, opts ...any) *http.Request
- func ErectResponse(t testing.TB, opts ...any) *http.Response
- func HTML(t testing.TB, res *http.Response, f func(*goquery.Document))
- func JSON(t testing.TB, res *http.Response, pairs ...any)
- func LogLogger(t TestLogger) *log.Logger
- func Logger(t TestLogger) *slog.Logger
- type MaybeLogger
- type TestLogger
Constants ¶
This section is empty.
Variables ¶
View Source
var DiscardLogger = slog.New(slog.NewTextHandler(io.Discard, nil))
DiscardLogger discards everything logged.
Functions ¶
func LogLogger ¶
func LogLogger(t TestLogger) *log.Logger
LogLogger returns a logger that logs to t.
func Logger ¶
func Logger(t TestLogger) *slog.Logger
Logger returns a logger that logs to t at slog.DebugLevel in text format without times and levels.
Types ¶
type MaybeLogger ¶
type MaybeLogger struct {
// contains filtered or unexported fields
}
MaybeLogger makes it easy to temporarily instrument code with debug logging.
func (*MaybeLogger) Attach ¶
func (m *MaybeLogger) Attach(t testing.TB)
func (*MaybeLogger) Disable ¶
func (m *MaybeLogger) Disable()
func (*MaybeLogger) Enable ¶
func (m *MaybeLogger) Enable(t TestLogger)
func (*MaybeLogger) Logf ¶
func (m *MaybeLogger) Logf(fmt string, args ...any)
type TestLogger ¶
TestLogger is the interface implemented by *testing.T and various similar types and adapters.
Click to show internal directories.
Click to hide internal directories.