mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
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:
parent
1cf6cf46bd
commit
d2b1c3ec5f
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user