Introduce trace-level logs to MessageBox

These will log sensitive information.
They are disabled when running with PYTHONOPTIMIZED.
They can only be enabled by setting a level lower than DEBUG,
which is difficult to do on accident.
This commit is contained in:
Lonami Exo
2022-12-17 23:13:06 +01:00
parent 5080715565
commit c72c7b160a
2 changed files with 43 additions and 2 deletions

View File

@@ -432,7 +432,7 @@ class TelegramBaseClient(abc.ABC):
# This is backported from v2 in a very ad-hoc way just to get proper update handling
self._catch_up = catch_up
self._updates_queue = asyncio.Queue()
self._message_box = MessageBox()
self._message_box = MessageBox(self._log['messagebox'])
# This entity cache is tailored for the messagebox and is not used for absolutely everything like _entity_cache
self._mb_entity_cache = MbEntityCache() # required for proper update handling (to know when to getDifference)