From d53e1c235b0814e6a2d5260fd4668f42c92b5348 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 9 Jan 2023 15:19:55 +0100 Subject: [PATCH] Lower the logging level of some log calls --- pyrogram/client.py | 2 +- pyrogram/connection/transport/tcp/tcp.py | 4 ++-- pyrogram/methods/auth/terminate.py | 2 +- pyrogram/methods/utilities/start.py | 2 +- pyrogram/parser/html.py | 2 +- pyrogram/session/session.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pyrogram/client.py b/pyrogram/client.py index 81828f5a..90aeb1f9 100644 --- a/pyrogram/client.py +++ b/pyrogram/client.py @@ -540,7 +540,7 @@ class Client(Methods): pts_count = getattr(update, "pts_count", None) if isinstance(update, raw.types.UpdateChannelTooLong): - log.warning(update) + log.info(update) if isinstance(update, raw.types.UpdateNewChannelMessage) and is_min: message = update.message diff --git a/pyrogram/connection/transport/tcp/tcp.py b/pyrogram/connection/transport/tcp/tcp.py index 08a435ce..82ef033b 100644 --- a/pyrogram/connection/transport/tcp/tcp.py +++ b/pyrogram/connection/transport/tcp/tcp.py @@ -91,7 +91,7 @@ class TCP: self.writer.close() await asyncio.wait_for(self.writer.wait_closed(), TCP.TIMEOUT) except Exception as e: - log.warning("Close exception: %s %s", type(e).__name__, e) + log.info("Close exception: %s %s", type(e).__name__, e) async def send(self, data: bytes): async with self.lock: @@ -100,7 +100,7 @@ class TCP: self.writer.write(data) await self.writer.drain() except Exception as e: - log.warning("Send exception: %s %s", type(e).__name__, e) + log.info("Send exception: %s %s", type(e).__name__, e) raise OSError(e) async def recv(self, length: int = 0): diff --git a/pyrogram/methods/auth/terminate.py b/pyrogram/methods/auth/terminate.py index 70cfc80e..d5fd949c 100644 --- a/pyrogram/methods/auth/terminate.py +++ b/pyrogram/methods/auth/terminate.py @@ -41,7 +41,7 @@ class Terminate: if self.takeout_id: await self.invoke(raw.functions.account.FinishTakeoutSession()) - log.warning("Takeout session %s finished", self.takeout_id) + log.info("Takeout session %s finished", self.takeout_id) await self.storage.save() await self.dispatcher.stop() diff --git a/pyrogram/methods/utilities/start.py b/pyrogram/methods/utilities/start.py index 19a7eb7c..d8314da1 100644 --- a/pyrogram/methods/utilities/start.py +++ b/pyrogram/methods/utilities/start.py @@ -63,7 +63,7 @@ class Start: if not await self.storage.is_bot() and self.takeout: self.takeout_id = (await self.invoke(raw.functions.account.InitTakeoutSession())).id - log.warning("Takeout session %s initiated", self.takeout_id) + log.info("Takeout session %s initiated", self.takeout_id) await self.invoke(raw.functions.updates.GetState()) except (Exception, KeyboardInterrupt): diff --git a/pyrogram/parser/html.py b/pyrogram/parser/html.py index 7edb7f3c..46722a8c 100644 --- a/pyrogram/parser/html.py +++ b/pyrogram/parser/html.py @@ -131,7 +131,7 @@ class HTML: for tag, entities in parser.tag_entities.items(): unclosed_tags.append(f"<{tag}> (x{len(entities)})") - log.warning("Unclosed tags: %s", ", ".join(unclosed_tags)) + log.info("Unclosed tags: %s", ", ".join(unclosed_tags)) entities = [] diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index 0dd34305..664416be 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -229,7 +229,7 @@ class Session: raise SecurityCheckMismatch("The msg_id belongs to over 300 seconds in the past. " "Most likely the client time has to be synchronized.") except SecurityCheckMismatch as e: - log.warning("Discarding packet: %s", e) + log.info("Discarding packet: %s", e) await self.connection.close() return else: