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
- type RestyAdapter
- type ThreadLocalTraceID
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 ¶
type RestyAdapter ¶ added in v2.7.4
RestyAdapter bridges resty.Logger to *slog.Logger.
func (RestyAdapter) Debugf ¶ added in v2.7.4
func (a RestyAdapter) Debugf(format string, v ...any)
func (RestyAdapter) Errorf ¶ added in v2.7.4
func (a RestyAdapter) Errorf(format string, v ...any)
func (RestyAdapter) Warnf ¶ added in v2.7.4
func (a RestyAdapter) Warnf(format string, v ...any)
type ThreadLocalTraceID ¶ added in v2.7.14
Click to show internal directories.
Click to hide internal directories.