Documentation
¶
Overview ¶
Package testlog captures slog records in tests (the gatekeeper's stand-in for zaptest/observer).
Index ¶
- type Record
- type Recorder
- func (r *Recorder) Contains(s string) bool
- func (r *Recorder) Enabled(context.Context, slog.Level) bool
- func (r *Recorder) Handle(_ context.Context, rec slog.Record) error
- func (r *Recorder) Records() []Record
- func (r *Recorder) WithAttrs(attrs []slog.Attr) slog.Handler
- func (r *Recorder) WithGroup(name string) slog.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder is a slog.Handler that keeps every record.
func (*Recorder) Contains ¶
Contains reports whether any record's message or attribute value contains s (for "never logs a secret" tests).