Documentation
¶
Overview ¶
Package bslog provides log archival as MongoDB BSON documents for log/slog.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
A Handler implements the slog.Handler interface.
func NewHandler ¶
func NewHandler(handler slog.Handler, collection *mongo.Collection) *Handler
NewHandler constructs a *Handler that wraps the given handler.
func (*Handler) Enabled ¶
Enabled implements the slog.Handler Enabled interface method. It calls the wrapped handler's Enabled method directly.
func (*Handler) Handle ¶
Handle implements the slog.Handler Handle interface method. It calls the wrapped handler's Handle method directly before persisting the log to MongoDB.
func (*Handler) WithAttrs ¶
WithAttrs implements the slog.Handler WithAttrs interface method. It calls the wrapped handler's WithAttrs method directly.
Click to show internal directories.
Click to hide internal directories.