Documentation
¶
Index ¶
- func FromContext(ctx context.Context) *slog.Logger
- func IntoContext(ctx context.Context, l *slog.Logger) context.Context
- func New(name string) *slog.Logger
- func NewContext(ctx context.Context, name string) context.Context
- func NewHandler(name string) slog.Handler
- func SubLogger(base *slog.Logger, suffix string) *slog.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext returns a logger from a context.Context; if the passed context is nil, we return the default slog logger.
func IntoContext ¶
IntoContext adds a logger to a context. Use FromContext to pull the logger out.
Types ¶
This section is empty.
Source Files
¶
- log.go
Click to show internal directories.
Click to hide internal directories.