Documentation ¶
Overview ¶
Package slogf provides a bridge between the slog and logf packages.
Index ¶
- func LogfLevel(level slog.Level) logf.Level
- type Handler
- func (h *Handler) Enabled(ctx context.Context, level slog.Level) bool
- func (h *Handler) Handle(ctx context.Context, record slog.Record) error
- func (h *Handler) WithAttrs(attrs []slog.Attr) slog.Handler
- func (h *Handler) WithGroup(key string) slog.Handler
- func (h *Handler) WithLogger(logger *logf.Logger) *Handler
- func (h *Handler) WithLoggerFunc(logger func(context.Context) *logf.Logger) *Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a slog.Handler implementation which uses logf.Logger to log records.
func NewHandler ¶
func NewHandler() *Handler
NewHandler returns a new slog.Handler which uses logf.Logger to log records.
func (*Handler) WithLogger ¶
WithLogger returns a new Handler with the given logger.
Click to show internal directories.
Click to hide internal directories.