Documentation ¶
Index ¶
- func CtxLogger(ctx context.Context) *slog.Logger
- func CtxLoggerWith(ctx context.Context, attrs ...slog.Attr) context.Context
- func CtxNow(ctx context.Context) time.Time
- func CtxRequestID(ctx context.Context) (model.RequestID, context.Context)
- func CtxWithLogger(ctx context.Context, logger *slog.Logger) context.Context
- func CtxWithNow(ctx context.Context, f nowFunc) context.Context
- func ErrLog(err error) slog.Attr
- func HandleError(ctx context.Context, msg string, err error)
- func LoadEnv(t *testing.T, key string) string
- func Logger() *slog.Logger
- func SafeClose(closer io.Closer)
- func SetLogger(l *slog.Logger)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CtxLoggerWith ¶
CtxLoggerWith returns a new logger with additional fields
func CtxRequestID ¶
CtxRequestID returns request ID from context. If request ID is not set, return new request ID and context with it
func CtxWithLogger ¶
CtxWithLogger returns a new context with logger
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.