From: Matt Joiner Date: Sun, 23 Aug 2015 02:59:03 +0000 (+1000) Subject: Add Debug flag to Config X-Git-Tag: v1.0.0~1056 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=4472a0e27abaa169c88b7359f4acca367a9ddea3;p=btrtrc.git Add Debug flag to Config I'll use this to squash the noisy logging for people who don't care. --- diff --git a/client.go b/client.go index f3d281f8..aba0ab33 100644 --- a/client.go +++ b/client.go @@ -1756,7 +1756,7 @@ func (me *Client) addConnection(t *torrent, c *connection) bool { if c == nil { return false } - if missinggo.CryHeard() { + if me.config.Debug && missinggo.CryHeard() { log.Printf("%s: dropping connection to make room for new one:\n %s", t, c) } c.Close() diff --git a/config.go b/config.go index 4bc12896..d6b79424 100644 --- a/config.go +++ b/config.go @@ -47,4 +47,6 @@ type Config struct { IPBlocklist *iplist.IPList DisableIPv6 bool + // Perform logging and any other behaviour that will help debug. + Debug bool }