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.
This commit is contained in:
Saxon Nelson-Milton 2023-06-23 23:40:30 +00:00
parent 452d25ac0c
commit ee7cb57fe5
1 changed files with 2 additions and 1 deletions

View File

@ -51,5 +51,6 @@ func GetLogger() logging.Logger {
if logger == nil { if logger == nil {
panic("attempted get of uninstantiated global logger") panic("attempted get of uninstantiated global logger")
} }
return logger // We want to return the underlying logger.
return logger.Logger
} }