Skip to content

Commit

Permalink
fix: log messages for subscribers
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Nov 25, 2024
1 parent 0e9cc02 commit c7ddc91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (h *Hub) registerSubscriber(w http.ResponseWriter, r *http.Request) (*Local
}
if err != nil || (claims == nil && !h.anonymous) {
http.Error(w, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized)
if c := h.logger.Check(zap.DebugLevel, "LocalSubscriber unauthorized"); c != nil {
if c := h.logger.Check(zap.DebugLevel, "Subscriber unauthorized"); c != nil {
c.Write(zap.Object("subscriber", s), zap.Error(err))
}

Expand Down Expand Up @@ -297,7 +297,7 @@ func (h *Hub) shutdown(s *LocalSubscriber) {
}

h.dispatchSubscriptionUpdate(s, false)
if c := h.logger.Check(zap.InfoLevel, "LocalSubscriber disconnected"); c != nil {
if c := h.logger.Check(zap.InfoLevel, "Subscriber disconnected"); c != nil {
c.Write(zap.Object("subscriber", s))
}
h.metrics.SubscriberDisconnected(s)
Expand Down

0 comments on commit c7ddc91

Please sign in to comment.