logging: Add zap.Option support (#5944)

This commit is contained in:
Francis Lavoie
2023-12-18 15:48:34 -05:00
committed by GitHub
parent da7d8cb26d
commit 3248e4c89f
2 changed files with 89 additions and 28 deletions

View File

@@ -68,7 +68,7 @@ func (h *Handler) handleUpgradeResponse(logger *zap.Logger, rw http.ResponseWrit
//nolint:bodyclose
conn, brw, hijackErr := http.NewResponseController(rw).Hijack()
if errors.Is(hijackErr, http.ErrNotSupported) {
h.logger.Sugar().Errorf("can't switch protocols using non-Hijacker ResponseWriter type %T", rw)
h.logger.Error("can't switch protocols using non-Hijacker ResponseWriter", zap.String("type", fmt.Sprintf("%T", rw)))
return
}