From: Matt Joiner Date: Tue, 22 Mar 2016 02:10:18 +0000 (+1100) Subject: Log connection errors when debug mode X-Git-Tag: v1.0.0~821 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=01bef851ed551d7d3ffc61f0bbbd927b47df1914;p=btrtrc.git Log connection errors when debug mode --- diff --git a/client.go b/client.go index a257cf84..0146ab4d 100644 --- a/client.go +++ b/client.go @@ -781,6 +781,9 @@ func (me *Client) outgoingConnection(t *torrent, addr string, ps peerSource) { // failure. me.noLongerHalfOpen(t, addr) if err != nil { + if me.config.Debug { + log.Printf("error establishing outgoing connection: %s", err) + } return } if c == nil { @@ -790,7 +793,9 @@ func (me *Client) outgoingConnection(t *torrent, addr string, ps peerSource) { c.Discovery = ps err = me.runInitiatedHandshookConn(c, t) if err != nil { - // log.Print(err) + if me.config.Debug { + log.Printf("error in established outgoing connection: %s", err) + } } }