Improved logging to app end

This commit is contained in:
Sven Heidemann 2023-03-30 14:43:21 +02:00
parent 17c2acd77c
commit 4a0a6a4631
2 changed files with 5 additions and 2 deletions

View File

@ -39,7 +39,7 @@ class Program:
) )
self.app: Application = await app_builder.build_async() self.app: Application = await app_builder.build_async()
await self.app.run_async() await self.app.run_async()
Console.write_line("Finished app.run_async") Console.write_line(f"[ INFO ] [ {__name__} ]: Finished app.run_async")
async def stop(self): async def stop(self):
if self.app is None: if self.app is None:

View File

@ -15,4 +15,7 @@ class LevelOnMessageEvent(OnMessageABC):
@EventChecks.check_is_ready() @EventChecks.check_is_ready()
async def on_message(self, message: discord.Message): async def on_message(self, message: discord.Message):
self._logger.debug(__name__, f"Module {type(self)} started") self._logger.debug(__name__, f"Module {type(self)} started")
try:
await self._level.check_level(message.author) await self._level.check_level(message.author)
except Exception as e:
self._logger.error(__name__, f"Level check by message failed", e)