logging: remove reamining instances of SetLogger interface (#7572)

This commit is contained in:
Sam Kleinman
2022-01-12 16:56:49 -05:00
committed by GitHub
parent 7a9a38d9d7
commit 2a348cc1e9
21 changed files with 103 additions and 89 deletions
+2 -6
View File
@@ -41,6 +41,7 @@ type WebsocketManager struct {
// NewWebsocketManager returns a new WebsocketManager that passes a map of
// functions, connection options and logger to new WS connections.
func NewWebsocketManager(
logger log.Logger,
funcMap map[string]*RPCFunc,
wsConnOptions ...func(*wsConnection),
) *WebsocketManager {
@@ -60,16 +61,11 @@ func NewWebsocketManager(
return true
},
},
logger: log.NewNopLogger(),
logger: logger,
wsConnOptions: wsConnOptions,
}
}
// SetLogger sets the logger.
func (wm *WebsocketManager) SetLogger(l log.Logger) {
wm.logger = l
}
// WebsocketHandler upgrades the request/response (via http.Hijack) and starts
// the wsConnection.
func (wm *WebsocketManager) WebsocketHandler(w http.ResponseWriter, r *http.Request) {