Documentation ¶
Index ¶
- Variables
- func NewRecorder(opts ...RecorderOptions) *recorder
- func SetupDefault()
- func Trace(sl *slog.Logger, msg string, args ...any)
- func TraceContext(ctx context.Context, sl *slog.Logger, msg string, args ...any)
- type BasicAuthHandler
- type Browser
- type BrowserOptions
- type Event
- type RecordCondition
- type RecorderOptions
- type SlogHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var LevelTrace = slog.Level(-8)
View Source
var Version = "v1.51.3"
because of a typo, versions have a gap between 1.15.3 and 1.50.0
Functions ¶
func NewRecorder ¶
func NewRecorder(opts ...RecorderOptions) *recorder
func SetupDefault ¶
func SetupDefault()
SetupDefault wraps the default log handler with a handler that records events. Logging all events on error detection is true. Maxium number of event groups in memory is 100. Installs the browser (page=100) on the default serve mux with path /nanny
Types ¶
type BasicAuthHandler ¶
BasicAuthHandler is a http.Handler that requires basic authentication. 95% Suggested by Google Duet
func NewBasicAuthHandler ¶
func NewBasicAuthHandler(handler http.Handler, username, password string) *BasicAuthHandler
func (*BasicAuthHandler) ServeHTTP ¶
func (h *BasicAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Browser ¶
type Browser struct {
// contains filtered or unexported fields
}
func NewBrowser ¶
func NewBrowser(rec *recorder, opts ...BrowserOptions) *Browser
type BrowserOptions ¶ added in v1.15.0
type RecordCondition ¶ added in v0.6.0
type RecordCondition struct { Name string Enabled bool Path string Value string // contains filtered or unexported fields }
func NewCondition ¶ added in v0.6.0
func NewCondition(name string, enabled bool, path string, value string) RecordCondition
func (RecordCondition) Matches ¶ added in v0.6.0
func (r RecordCondition) Matches(ev *Event) bool
Matches returns true if the event matches the specification of this condition.
func (RecordCondition) String ¶ added in v0.6.0
func (c RecordCondition) String() string
type RecorderOptions ¶ added in v1.15.0
type RecorderOptions struct { MaxEventsMemoryBytes int64 // zero means no limit MaxEventGroups int // zero means no limit MaxEvents int // zero means no limit GroupMarkers []string // one or more attribute names for grouping events LogEventGroupOnError bool // if an Error event is recorded then all leading debug and trace events in the same group are logger first }
RecorderOptions holds all configuration options for keeping a window of events. The maxima are handled in order of precedence: MaxEventsMemoryBytes->MaxEventGroups->MaxEvents.
type SlogHandler ¶
type SlogHandler struct {
// contains filtered or unexported fields
}
func NewLogHandler ¶
func NewLogHandler(recorder *recorder, passThroughHandler slog.Handler, level slog.Level) *SlogHandler
Source Files ¶
Click to show internal directories.
Click to hide internal directories.