Skip to content

Commit

Permalink
Convert errors to warnings as per review
Browse files Browse the repository at this point in the history
  • Loading branch information
srebhan committed May 16, 2023
1 parent c8f63d4 commit 3475ea5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/inputs/socket_listener/stream_listener.go
Expand Up @@ -111,15 +111,15 @@ func (l *streamListener) setupConnection(conn net.Conn) error {
}
if *l.KeepAlivePeriod == 0 {
if err := tcpConn.SetKeepAlive(false); err != nil {
l.Log.Errorf("cannot set keep-alive: %w", err)
l.Log.Warnf("Cannot set keep-alive: %w", err)
}
} else {
if err := tcpConn.SetKeepAlive(true); err != nil {
l.Log.Errorf("cannot set keep-alive: %w", err)
l.Log.Warnf("Cannot set keep-alive: %w", err)
}
err := tcpConn.SetKeepAlivePeriod(time.Duration(*l.KeepAlivePeriod))
if err != nil {
l.Log.Errorf("cannot set keep-alive period: %w", err)
l.Log.Warnf("Cannot set keep-alive period: %w", err)
}
}
}
Expand All @@ -130,7 +130,7 @@ func (l *streamListener) setupConnection(conn net.Conn) error {
func (l *streamListener) closeConnection(conn net.Conn) {
addr := conn.RemoteAddr().String()
if err := conn.Close(); err != nil {
l.Log.Errorf("Cannot close connection to %q: %v", addr, err)
l.Log.Warnf("Cannot close connection to %q: %v", addr, err)
}
delete(l.connections, addr)
}
Expand Down

0 comments on commit 3475ea5

Please sign in to comment.