Просмотр исходного кода

Enhanced debug logging in bot initialization

Introduced additional debug log entries in the `GPTBot` class to provide clarity on the initial sync and callback setup process. This helps with monitoring and troubleshooting during the early stages of bot deployment, making it easier to pinpoint issues around bot startup and room joining behavior.
Bumped project version to 0.3.3-dev to signal ongoing development.
Kumi 11 месяцев назад
Родитель
Сommit
c7e448126d
2 измененных файлов с 6 добавлено и 1 удалено
  1. 1 1
      pyproject.toml
  2. 5 0
      src/gptbot/classes/bot.py

+ 1 - 1
pyproject.toml

@@ -7,7 +7,7 @@ allow-direct-references = true
 
 [project]
 name = "matrix-gptbot"
-version = "0.3.2"
+version = "0.3.3-dev"
 
 authors = [
   { name="Kumi Mitterer", email="gptbot@kumi.email" },

+ 5 - 0
src/gptbot/classes/bot.py

@@ -816,6 +816,9 @@ class GPTBot:
         self.matrix_client.config = client_config
 
         # Run initial sync (includes joining rooms)
+
+        self.logger.log("Running initial sync...", "debug")
+
         sync = await self.matrix_client.sync(timeout=30000, full_state=True)
         if isinstance(sync, SyncResponse):
             await self.response_callback(sync)
@@ -825,6 +828,8 @@ class GPTBot:
 
         # Set up callbacks
 
+        self.logger.log("Setting up callbacks...", "debug")
+
         self.matrix_client.add_event_callback(self.event_callback, Event)
         self.matrix_client.add_response_callback(self.response_callback, Response)