From e9c7cf6f63b329975b82055b4e24ff544987da26 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 21 Jan 2021 14:51:59 -0500 Subject: [PATCH] logging --- lbry/utils.py | 2 +- lbry/wallet/network.py | 6 +++--- lbry/wallet/server/session.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lbry/utils.py b/lbry/utils.py index 4202a2e27..7b2b72886 100644 --- a/lbry/utils.py +++ b/lbry/utils.py @@ -231,7 +231,7 @@ class LRUCacheWithMetrics: f"{metric_name}_cache_miss_count", "Number of cache misses", namespace=namespace ) except ValueError as err: - log.warning("failed to set up prometheus %s_cache_miss_count metric: %s", metric_name, err) + log.debug("failed to set up prometheus %s_cache_miss_count metric: %s", metric_name, err) self._track_metrics = False self.hits = self.misses = None diff --git a/lbry/wallet/network.py b/lbry/wallet/network.py index 19e7166c1..da23dc4c3 100644 --- a/lbry/wallet/network.py +++ b/lbry/wallet/network.py @@ -67,7 +67,7 @@ class ClientSession(BaseClientSession): log.debug("Time since last packet: %s", perf_counter() - self.last_packet_received) if (perf_counter() - self.last_packet_received) < self.timeout: continue - log.info("timeout sending %s to %s:%i", method, *self.server) + log.warning("timeout sending %s to %s:%i", method, *self.server) raise asyncio.TimeoutError if done: try: @@ -87,7 +87,7 @@ class ClientSession(BaseClientSession): self.synchronous_close() raise except asyncio.CancelledError: - log.info("cancelled sending %s to %s:%i", method, *self.server) + log.warning("cancelled sending %s to %s:%i", method, *self.server) # self.synchronous_close() raise finally: @@ -145,7 +145,7 @@ class ClientSession(BaseClientSession): controller.add(request.args) def connection_lost(self, exc): - log.debug("Connection lost: %s:%d", *self.server) + log.warning("Connection lost: %s:%d", *self.server) super().connection_lost(exc) self.response_time = None self.connection_latency = None diff --git a/lbry/wallet/server/session.py b/lbry/wallet/server/session.py index 37c06e19d..ef41b869b 100644 --- a/lbry/wallet/server/session.py +++ b/lbry/wallet/server/session.py @@ -582,6 +582,7 @@ class SessionManager: ]) finally: await self._close_servers(list(self.servers.keys())) + log.warning("disconnect %i sessions", len(self.sessions)) if self.sessions: await asyncio.wait([ session.close(force_after=1) for session in self.sessions.values()