Lower severity of some log messages during update handling

Some people were complaining that their logs were being spammed by it.
This commit is contained in:
Lonami Exo 2022-10-02 16:07:14 +02:00
parent 1cf6cf46bd
commit d2b1c3ec5f

View File

@ -275,7 +275,7 @@ class UpdateMethods:
get_diff = self._message_box.get_difference() get_diff = self._message_box.get_difference()
if get_diff: if get_diff:
self._log[__name__].info('Getting difference for account updates') self._log[__name__].debug('Getting difference for account updates')
try: try:
diff = await self(get_diff) diff = await self(get_diff)
except (errors.ServerError, ValueError) as e: except (errors.ServerError, ValueError) as e:
@ -289,12 +289,15 @@ class UpdateMethods:
self._message_box.end_difference() self._message_box.end_difference()
continue continue
updates, users, chats = self._message_box.apply_difference(diff, self._mb_entity_cache) updates, users, chats = self._message_box.apply_difference(diff, self._mb_entity_cache)
if updates:
self._log[__name__].info('Got difference for account updates')
updates_to_dispatch.extend(self._preprocess_updates(updates, users, chats)) updates_to_dispatch.extend(self._preprocess_updates(updates, users, chats))
continue continue
get_diff = self._message_box.get_channel_difference(self._mb_entity_cache) get_diff = self._message_box.get_channel_difference(self._mb_entity_cache)
if get_diff: if get_diff:
self._log[__name__].info('Getting difference for channel %s updates', get_diff.channel.channel_id) self._log[__name__].debug('Getting difference for channel %s updates', get_diff.channel.channel_id)
try: try:
diff = await self(get_diff) diff = await self(get_diff)
except ( except (
@ -348,6 +351,9 @@ class UpdateMethods:
continue continue
updates, users, chats = self._message_box.apply_channel_difference(get_diff, diff, self._mb_entity_cache) updates, users, chats = self._message_box.apply_channel_difference(get_diff, diff, self._mb_entity_cache)
if updates:
self._log[__name__].info('Got difference for channel %d updates', get_diff.channel.channel_id)
updates_to_dispatch.extend(self._preprocess_updates(updates, users, chats)) updates_to_dispatch.extend(self._preprocess_updates(updates, users, chats))
continue continue
@ -358,7 +364,7 @@ class UpdateMethods:
try: try:
updates = await asyncio.wait_for(self._updates_queue.get(), deadline_delay) updates = await asyncio.wait_for(self._updates_queue.get(), deadline_delay)
except asyncio.TimeoutError: except asyncio.TimeoutError:
self._log[__name__].info('Timeout waiting for updates expired') self._log[__name__].debug('Timeout waiting for updates expired')
continue continue
else: else:
continue continue