Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogWithContext ¶
LogWithContext returns a logger with trace information.
Types ¶
type ObservedLogs ¶
type ObservedLogs struct {
// contains filtered or unexported fields
}
ObservedLogs is a structure that holds observed logs.
func NewLogObserver ¶
func NewLogObserver() (func(slog.Handler) slog.Handler, *ObservedLogs)
NewLogObserver returns a new observer and the observed logs.
func (*ObservedLogs) All ¶
func (l *ObservedLogs) All() []slog.Record
All returns all the observed logs.
func (*ObservedLogs) Clean ¶
func (l *ObservedLogs) Clean() *ObservedLogs
Clean clears the observed logs.
func (*ObservedLogs) ErrorCount ¶ added in v0.8.0
func (l *ObservedLogs) ErrorCount() int
ErrorCount returns the number of observed logs with level error.
func (*ObservedLogs) Filter ¶
func (l *ObservedLogs) Filter(filter func(slog.Record) bool) *ObservedLogs
Filter returns a new observed logs with the provided filter applied.
func (*ObservedLogs) Len ¶
func (l *ObservedLogs) Len() int
Len returns the number of observed logs.
Click to show internal directories.
Click to hide internal directories.