From 7c82285954a4808737823297bc0aaf2cdd8ba56f Mon Sep 17 00:00:00 2001 From: kpacha Date: Thu, 7 Mar 2024 15:12:32 +0100 Subject: [PATCH] fix log messages Signed-off-by: kpacha --- proxy/concurrent.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/proxy/concurrent.go b/proxy/concurrent.go index 2e4449682..e712dce3f 100644 --- a/proxy/concurrent.go +++ b/proxy/concurrent.go @@ -5,6 +5,7 @@ package proxy import ( "context" "errors" + "fmt" "time" "github.com/luraproject/lura/v2/config" @@ -14,16 +15,16 @@ import ( // NewConcurrentMiddlewareWithLogger creates a proxy middleware that enables sending several requests concurrently func NewConcurrentMiddlewareWithLogger(logger logging.Logger, remote *config.Backend) Middleware { if remote.ConcurrentCalls == 1 { - logger.Fatal("too few concurrent calls for %s %s -> %s: NewConcurrentMiddleware expects more than 1 concurrent call, got %d", - remote.ParentEndpointMethod, remote.ParentEndpoint, remote.URLPattern, remote.ConcurrentCalls) + logger.Fatal(fmt.Sprintf("too few concurrent calls for %s %s -> %s: NewConcurrentMiddleware expects more than 1 concurrent call, got %d", + remote.ParentEndpointMethod, remote.ParentEndpoint, remote.URLPattern, remote.ConcurrentCalls)) return nil } serviceTimeout := time.Duration(75*remote.Timeout.Nanoseconds()/100) * time.Nanosecond return func(next ...Proxy) Proxy { if len(next) > 1 { - logger.Fatal("too many proxies for this %s -> %s proxy middleware: NewConcurrentMiddleware only accepts 1 proxy, got %d", - remote.ParentEndpointMethod, remote.ParentEndpoint, remote.URLPattern, len(next)) + logger.Fatal(fmt.Sprintf("too many proxies for this %s %s -> %s proxy middleware: NewConcurrentMiddleware only accepts 1 proxy, got %d", + remote.ParentEndpointMethod, remote.ParentEndpoint, remote.URLPattern, len(next))) return nil }