fix(lib): add the ability to set a custom slog Logger (#915)

* fix(lib): add the ability to set a custom slog Logger

Closes #864

* test(lib): amend s.check usage

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
Signed-off-by: Xe Iaso <xe.iaso@techaro.lol>
This commit is contained in:
Xe Iaso 2025-07-31 08:06:35 -04:00 committed by GitHub
parent 6ae386a11a
commit 1f7fcf938b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 25 additions and 17 deletions

View file

@ -26,8 +26,8 @@ func InitSlog(level string) {
slog.SetDefault(slog.New(h))
}
func GetRequestLogger(r *http.Request) *slog.Logger {
return slog.With(
func GetRequestLogger(base *slog.Logger, r *http.Request) *slog.Logger {
return base.With(
"host", r.Host,
"method", r.Method,
"path", r.URL.Path,