Documentation
¶
Index ¶
- func ContextLoggerWithFields(ctx context.Context, fields ...any) context.Context
- func Error(err error) slog.Attr
- func GetLoggerWithFields(ctx context.Context, fields ...any) *slog.Logger
- func LoggerOf(ctx context.Context) *slog.Logger
- func WithLogger(ctx context.Context, logger *slog.Logger) context.Context
- func WithTraceId(ctx context.Context, record slog.Record) (slog.Record, bool, error)
- func Wrap(handler slog.Handler, middleware Middleware) slog.Handler
- type Middleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextLoggerWithFields ¶
ContextLoggerWithFields gets a logger with some fields pre-applied. deprecated, use `WithLogger(LoggerOf(ctx).With(fields...))`
func GetLoggerWithFields ¶
GetLoggerWithFields gets a logger with some fields pre-applied. deprecated, use `LoggerOf(ctx).With(fields...)`
func WithLogger ¶
WithLogger stores the entry into the context so it can be retrieved with LoggerOf later.
func WithTraceId ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.