From 7f0709888ca9a13d30165c7ba887c6f41a8cf5a2 Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Wed, 18 Oct 2023 15:36:55 +0300 Subject: [PATCH] fix http status helpers --- core/logger/attrs.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/logger/attrs.go b/core/logger/attrs.go index 518d180..8674c7c 100644 --- a/core/logger/attrs.go +++ b/core/logger/attrs.go @@ -25,8 +25,12 @@ func ErrAttr(err any) slog.Attr { return slog.Any(ErrorAttr, err) } -func HTTPStatus(code int) []any { - return []any{slog.Int(HTTPStatusAttr, code), slog.String(HTTPStatusNameAttr, http.StatusText(code))} +func HTTPStatusCode(code int) slog.Attr { + return slog.Int(HTTPStatusAttr, code) +} + +func HTTPStatusName(code int) slog.Attr { + return slog.String(HTTPStatusNameAttr, http.StatusText(code)) } func Body(val any) slog.Attr {