From 17c2acd77ceb9a12b8b33bf2457bcc5e0d9ac024 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 30 Mar 2023 14:37:02 +0200 Subject: [PATCH] Improved logging to app end --- kdb-bot/src/bot/application.py | 6 +++--- kdb-bot/src/bot/main.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kdb-bot/src/bot/application.py b/kdb-bot/src/bot/application.py index 34872d59..f479fbac 100644 --- a/kdb-bot/src/bot/application.py +++ b/kdb-bot/src/bot/application.py @@ -52,7 +52,7 @@ class Application(DiscordBotApplicationABC): self._api.join() return - self._logger.trace(__name__, f"Try to start {DiscordBotService.__name__}") + self._logger.info(__name__, f"Try to start {DiscordBotService.__name__}") await self._bot.start_async() await self._bot.stop_async() except Exception as e: @@ -64,9 +64,9 @@ class Application(DiscordBotApplicationABC): self._is_stopping = True try: - self._logger.trace(__name__, f"Try to stop {DiscordBotService.__name__}") + self._logger.info(__name__, f"Try to stop {DiscordBotService.__name__}") await self._bot.close() - self._logger.trace(__name__, f"Stopped {DiscordBotService.__name__}") + self._logger.info(__name__, f"Stopped {DiscordBotService.__name__}") except Exception as e: self._logger.error(__name__, "stop failed", e) diff --git a/kdb-bot/src/bot/main.py b/kdb-bot/src/bot/main.py index ed03af25..88e48aa0 100644 --- a/kdb-bot/src/bot/main.py +++ b/kdb-bot/src/bot/main.py @@ -39,6 +39,7 @@ class Program: ) self.app: Application = await app_builder.build_async() await self.app.run_async() + Console.write_line("Finished app.run_async") async def stop(self): if self.app is None: