From 4472a0e27abaa169c88b7359f4acca367a9ddea3 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sun, 23 Aug 2015 12:59:03 +1000 Subject: [PATCH] Add Debug flag to Config I'll use this to squash the noisy logging for people who don't care. --- client.go | 2 +- config.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 } -- 2.48.1