From 971eee8272d3de1073f3b03754057066c99de667 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 17 Mar 2022 12:52:53 +0100 Subject: [PATCH] SetContextualLogger: remove unintentionally merged API call The SetContextualLogger call is from an earlier draft for contextual logging and was replaced by SetLoggerWithOptions. It shouldn't have been merged in the first place. --- contextual.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/contextual.go b/contextual.go index bb038089..33743ffb 100644 --- a/contextual.go +++ b/contextual.go @@ -46,10 +46,6 @@ var ( // globalLogger. globalLoggerOptions loggerOptions - // contextualLogger defines whether globalLogger may get called - // directly. - contextualLogger bool - // klogLogger is used as fallback for logging through the normal klog code // when no Logger is set. klogLogger logr.Logger = logr.New(&klogger{}) @@ -137,15 +133,6 @@ type loggerOptions struct { flush func() } -// SetContextualLogger does the same as SetLogger, but in addition the -// logger may also get called directly by code that retrieves it -// with FromContext, TODO or Background. The logger therefore must -// implements its own verbosity checking. -func SetContextualLogger(logger logr.Logger) { - globalLogger = &logger - contextualLogger = true -} - // ClearLogger removes a backing Logger implementation if one was set earlier // with SetLogger. //