Skip to content

Commit

Permalink
Replace a number of warn log lines with debug (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomer-stripe authored Oct 7, 2019
1 parent 5e83354 commit 71706a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pkg/logtailing/tailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (tailer *Tailer) Run() error {

func (tailer *Tailer) processRequestLogEvent(msg websocket.IncomingMessage) {
if msg.RequestLogEvent == nil {
tailer.cfg.Log.Warn("WebSocket specified for request logs received non-request-logs event")
tailer.cfg.Log.Debug("WebSocket specified for request logs received non-request-logs event")
return
}

Expand All @@ -173,7 +173,7 @@ func (tailer *Tailer) processRequestLogEvent(msg websocket.IncomingMessage) {

var payload EventPayload
if err := json.Unmarshal([]byte(requestLogEvent.EventPayload), &payload); err != nil {
tailer.cfg.Log.Warn("Received malformed payload: ", err)
tailer.cfg.Log.Debug("Received malformed payload: ", err)
}

// Don't show stripecli/sessions logs since they're generated by the CLI
Expand Down
4 changes: 2 additions & 2 deletions pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (p *Proxy) filterWebhookEvent(msg *websocket.WebhookEvent) bool {

func (p *Proxy) processWebhookEvent(msg websocket.IncomingMessage) {
if msg.WebhookEvent == nil {
p.cfg.Log.Warn("WebSocket specified for Webhooks received non-webhook event")
p.cfg.Log.Debug("WebSocket specified for Webhooks received non-webhook event")
return
}

Expand All @@ -186,7 +186,7 @@ func (p *Proxy) processWebhookEvent(msg websocket.IncomingMessage) {
var evt stripeEvent
err := json.Unmarshal([]byte(webhookEvent.EventPayload), &evt)
if err != nil {
p.cfg.Log.Warn("Received malformed event from Stripe, ignoring")
p.cfg.Log.Debug("Received malformed event from Stripe, ignoring")
return
}

Expand Down
12 changes: 6 additions & 6 deletions pkg/websocket/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ func (c *Client) readPump() {

err := c.conn.SetReadDeadline(time.Now().Add(c.cfg.PongWait))
if err != nil {
c.cfg.Log.Warn("SetReadDeadline error: ", err)
c.cfg.Log.Debug("SetReadDeadline error: ", err)
}
c.conn.SetPongHandler(func(string) error {
c.cfg.Log.WithFields(log.Fields{
"prefix": "websocket.Client.readPump",
}).Debug("Received pong message")
err := c.conn.SetReadDeadline(time.Now().Add(c.cfg.PongWait))
if err != nil {
c.cfg.Log.Warn("SetReadDeadline error: ", err)
c.cfg.Log.Debug("SetReadDeadline error: ", err)
}
return nil
})
Expand Down Expand Up @@ -242,7 +242,7 @@ func (c *Client) readPump() {

var msg IncomingMessage
if err = json.Unmarshal(data, &msg); err != nil {
c.cfg.Log.Warn("Received malformed message: ", err)
c.cfg.Log.Debug("Received malformed message: ", err)
continue
}

Expand All @@ -268,15 +268,15 @@ func (c *Client) writePump() {
case whResp, ok := <-c.send:
err := c.conn.SetWriteDeadline(time.Now().Add(c.cfg.WriteWait))
if err != nil {
c.cfg.Log.Warn("SetWriteDeadline error: ", err)
c.cfg.Log.Debug("SetWriteDeadline error: ", err)
}
if !ok {
c.cfg.Log.WithFields(log.Fields{
"prefix": "websocket.Client.writePump",
}).Debug("Sending close message")
err = c.conn.WriteMessage(ws.CloseMessage, ws.FormatCloseMessage(ws.CloseNormalClosure, ""))
if err != nil {
c.cfg.Log.Warn("WriteMessage error: ", err)
c.cfg.Log.Debug("WriteMessage error: ", err)
}
return
}
Expand All @@ -298,7 +298,7 @@ func (c *Client) writePump() {
case <-ticker.C:
err := c.conn.SetWriteDeadline(time.Now().Add(c.cfg.WriteWait))
if err != nil {
c.cfg.Log.Warn("SetWriteDeadline error: ", err)
c.cfg.Log.Debug("SetWriteDeadline error: ", err)
}
c.cfg.Log.WithFields(log.Fields{
"prefix": "websocket.Client.writePump",
Expand Down

0 comments on commit 71706a0

Please sign in to comment.