mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-18 13:34:54 +00:00
Better logs
This commit is contained in:
parent
463ef828c2
commit
68133e8be5
@ -209,8 +209,7 @@ class Session:
|
|||||||
self.start()
|
self.start()
|
||||||
|
|
||||||
async def net_worker(self):
|
async def net_worker(self):
|
||||||
name = threading.current_thread().name
|
log.info("NetWorkerTask started")
|
||||||
log.debug("{} started".format(name))
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
packet = await self.recv_queue.get()
|
packet = await self.recv_queue.get()
|
||||||
@ -277,10 +276,10 @@ class Session:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(e, exc_info=True)
|
log.error(e, exc_info=True)
|
||||||
|
|
||||||
log.debug("{} stopped".format(name))
|
log.info("NetWorkerTask stopped")
|
||||||
|
|
||||||
async def ping(self):
|
async def ping(self):
|
||||||
log.debug("Ping Task started")
|
log.info("PingTask started")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
@ -298,10 +297,10 @@ class Session:
|
|||||||
except (OSError, TimeoutError, Error):
|
except (OSError, TimeoutError, Error):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
log.debug("Ping Task stopped")
|
log.info("PingTask stopped")
|
||||||
|
|
||||||
async def next_salt(self):
|
async def next_salt(self):
|
||||||
log.debug("NextSaltThread started")
|
log.info("NextSaltTask started")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
@ -331,10 +330,10 @@ class Session:
|
|||||||
self.connection.close()
|
self.connection.close()
|
||||||
break
|
break
|
||||||
|
|
||||||
log.debug("NextSaltThread stopped")
|
log.info("NextSaltTask stopped")
|
||||||
|
|
||||||
async def recv(self):
|
async def recv(self):
|
||||||
log.debug("Recv Task started")
|
log.info("RecvTask started")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
packet = await self.connection.recv()
|
packet = await self.connection.recv()
|
||||||
@ -350,7 +349,7 @@ class Session:
|
|||||||
|
|
||||||
self.recv_queue.put_nowait(packet)
|
self.recv_queue.put_nowait(packet)
|
||||||
|
|
||||||
log.debug("Recv Task stopped")
|
log.info("RecvTask stopped")
|
||||||
|
|
||||||
async def _send(self, data: Object, wait_response: bool = True):
|
async def _send(self, data: Object, wait_response: bool = True):
|
||||||
message = self.msg_factory(data)
|
message = self.msg_factory(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user