Browse Source

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 months ago
parent
commit
c7e448126d
2 changed files with 6 additions and 1 deletions
  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]
 [project]
 name = "matrix-gptbot"
 name = "matrix-gptbot"
-version = "0.3.2"
+version = "0.3.3-dev"
 
 
 authors = [
 authors = [
   { name="Kumi Mitterer", email="gptbot@kumi.email" },
   { 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
         self.matrix_client.config = client_config
 
 
         # Run initial sync (includes joining rooms)
         # Run initial sync (includes joining rooms)
+
+        self.logger.log("Running initial sync...", "debug")
+
         sync = await self.matrix_client.sync(timeout=30000, full_state=True)
         sync = await self.matrix_client.sync(timeout=30000, full_state=True)
         if isinstance(sync, SyncResponse):
         if isinstance(sync, SyncResponse):
             await self.response_callback(sync)
             await self.response_callback(sync)
@@ -825,6 +828,8 @@ class GPTBot:
 
 
         # Set up callbacks
         # Set up callbacks
 
 
+        self.logger.log("Setting up callbacks...", "debug")
+
         self.matrix_client.add_event_callback(self.event_callback, Event)
         self.matrix_client.add_event_callback(self.event_callback, Event)
         self.matrix_client.add_response_callback(self.response_callback, Response)
         self.matrix_client.add_response_callback(self.response_callback, Response)