From 188aa800b2eed2707fa9af10d2ebc54b3219883a Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 28 Apr 2020 09:14:24 +1000 Subject: [PATCH] Adjust websocket tracker logging levels --- webtorrent/tracker_client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webtorrent/tracker_client.go b/webtorrent/tracker_client.go index 0948cdcd..c2052b99 100644 --- a/webtorrent/tracker_client.go +++ b/webtorrent/tracker_client.go @@ -91,7 +91,11 @@ func (tc *TrackerClient) Run() error { for !tc.closed { tc.mu.Unlock() err := tc.doWebsocket() - tc.Logger.WithDefaultLevel(log.Warning).Printf("websocket instance ended: %v", err) + level := log.Info + if tc.closed { + level = log.Debug + } + tc.Logger.WithDefaultLevel(level).Printf("websocket instance ended: %v", err) time.Sleep(time.Minute) tc.mu.Lock() }