From ee7cb57fe5b8f5cc43fe2230dc838b415537688d Mon Sep 17 00:00:00 2001 From: Saxon Nelson-Milton Date: Fri, 23 Jun 2023 23:40:30 +0000 Subject: [PATCH] vidforward: global logger returns underlying logger The globalLogger type wraps a logger.Logger. If you use GetLogger which gets the global logger (which provides an interface logger.Logger) a type assertion to JSONLogger will fail, because the type is actually globalLogger. We need to provide the underlying logger instead when we return from GetLogger. --- cmd/vidforward/global/logger.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/vidforward/global/logger.go b/cmd/vidforward/global/logger.go index b082dcc8..cb04c7e9 100644 --- a/cmd/vidforward/global/logger.go +++ b/cmd/vidforward/global/logger.go @@ -51,5 +51,6 @@ func GetLogger() logging.Logger { if logger == nil { panic("attempted get of uninstantiated global logger") } - return logger + // We want to return the underlying logger. + return logger.Logger }