Skip to content

Commit

Permalink
FIX #13389
Browse files Browse the repository at this point in the history
Dummy fix. Implement wsproxy.Logger with zap.Logger. Use sctx.lg as logger.

Signed-off-by: anon <[email protected]>
  • Loading branch information
anon authored and anon committed Mar 10, 2023
1 parent 659c74e commit 4dad1ed
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions server/embed/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,18 @@ func (sctx *serveCtx) registerGateway(opts []grpc.DialOption) (*gw.ServeMux, err
return gwmux, nil
}

type wsProxyZapLogger struct {
*zap.Logger
}

func (w wsProxyZapLogger) Warnln(i ...interface{}) {
w.Warn(fmt.Sprint(i...))
}

func (w wsProxyZapLogger) Debugln(i ...interface{}) {
w.Debug(fmt.Sprint(i...))
}

func (sctx *serveCtx) createMux(gwmux *gw.ServeMux, handler http.Handler) *http.ServeMux {
httpmux := http.NewServeMux()
for path, h := range sctx.userHandlers {
Expand All @@ -316,6 +328,7 @@ func (sctx *serveCtx) createMux(gwmux *gw.ServeMux, handler http.Handler) *http.
},
),
wsproxy.WithMaxRespBodyBufferSize(0x7fffffff),
wsproxy.WithLogger(wsProxyZapLogger{sctx.lg}),
),
)
}
Expand Down

0 comments on commit 4dad1ed

Please sign in to comment.