forked from LBRYCommunity/lbry-sdk
logging
This commit is contained in:
parent
68f1661452
commit
e9c7cf6f63
3 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue