From a72d3fffea69da59bb67f45ff4aecbbb71d349c4 Mon Sep 17 00:00:00 2001 From: Andreas Sommer Date: Mon, 6 Nov 2023 18:13:00 +0100 Subject: [PATCH] Fix creation of logger with new setting --- pkg/logger/logger.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/logger/logger.go b/pkg/logger/logger.go index 00916a1511..6267cbe35d 100644 --- a/pkg/logger/logger.go +++ b/pkg/logger/logger.go @@ -88,11 +88,13 @@ func (c *Logger) GetLogger() logr.Logger { } func (c *Logger) WithValues(keysAndValues ...any) *Logger { - c.logger = c.logger.WithValues(keysAndValues...) - return c + return &Logger{ + logger: c.logger.WithValues(keysAndValues...), + } } func (c *Logger) WithName(name string) *Logger { - c.logger = c.logger.WithName(name) - return c + return &Logger{ + logger: c.logger.WithName(name), + } }