From b252e20f92d11efefe069d5afeb547cd95463b61 Mon Sep 17 00:00:00 2001 From: hfuss Date: Fri, 12 Dec 2025 08:38:18 -0500 Subject: [PATCH] [ffapi] Ensure Default Log Level is Set in Handler Signed-off-by: hfuss --- pkg/ffapi/handler.go | 4 +++- pkg/ffapi/handler_test.go | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/ffapi/handler.go b/pkg/ffapi/handler.go index 541ec54..9409b1e 100644 --- a/pkg/ffapi/handler.go +++ b/pkg/ffapi/handler.go @@ -365,8 +365,10 @@ func (hs *HandlerFactory) getTimeout(req *http.Request) time.Duration { } func (hs *HandlerFactory) APIWrapper(handler HandlerFunction) http.HandlerFunc { + if hs.apiEntryLoggingLevel == 0 { + hs.SetAPIEntryLoggingLevel(logrus.InfoLevel) + } return func(res http.ResponseWriter, req *http.Request) { - reqTimeout := hs.getTimeout(req) ctx, cancel := context.WithTimeout(req.Context(), reqTimeout) httpReqID := req.Header.Get(RequestIDHeader()) diff --git a/pkg/ffapi/handler_test.go b/pkg/ffapi/handler_test.go index 2dc1cf7..3db1ace 100644 --- a/pkg/ffapi/handler_test.go +++ b/pkg/ffapi/handler_test.go @@ -60,7 +60,6 @@ func newTestHandlerFactory(basePath string, basePathParams []*PathParam) *Handle BasePath: basePath, BasePathParams: basePathParams, } - hr.SetAPIEntryLoggingLevel(logrus.DebugLevel) return hr }