19 lines
345 B
Go
19 lines
345 B
Go
package email
|
|
|
|
import (
|
|
"log/slog"
|
|
"testing"
|
|
)
|
|
|
|
func testLogger(t *testing.T) *slog.Logger {
|
|
t.Helper()
|
|
return slog.New(slog.NewTextHandler(&testWriter{t: t}, &slog.HandlerOptions{Level: slog.LevelWarn}))
|
|
}
|
|
|
|
type testWriter struct{ t *testing.T }
|
|
|
|
func (w *testWriter) Write(p []byte) (int, error) {
|
|
w.t.Logf("%s", p)
|
|
return len(p), nil
|
|
}
|