Skip to content

Commit df09c6c

Browse files
committed
Remove debug logging from avatar handler
1 parent e250e3f commit df09c6c

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

jupyter_ai_persona_manager/handlers.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,12 @@ class AvatarHandler(JupyterHandler):
3131
@tornado.web.authenticated
3232
async def get(self, filename: str):
3333
"""Serve an avatar file by filename."""
34-
self.log.info(f"Avatar request for filename: {filename}")
35-
3634
# Get the avatar file path from persona managers
3735
avatar_path = self._find_avatar_file(filename)
3836

3937
if avatar_path is None:
40-
self.log.warning(f"Avatar file not found for filename: {filename}")
4138
raise tornado.web.HTTPError(404, f"Avatar file not found: {filename}")
4239

43-
self.log.info(f"Found avatar at: {avatar_path}")
44-
4540
# Serve the file
4641
try:
4742
# Set content type based on file extension
@@ -66,31 +61,22 @@ def _find_avatar_file(self, filename: str) -> Optional[str]:
6661
6762
Uses LRU cache to avoid repeated lookups for the same filename.
6863
"""
69-
self.log.info(f"Looking up avatar file: {filename}")
70-
7164
# Get all persona managers from settings
7265
persona_managers = self.settings.get('jupyter-ai', {}).get('persona-managers', {})
73-
self.log.info(f"Found {len(persona_managers)} persona managers")
7466

7567
for room_id, persona_manager in persona_managers.items():
76-
self.log.info(f"Checking room {room_id} with {len(persona_manager.personas)} personas")
7768
# Check each persona's avatar path
7869
for persona in persona_manager.personas.values():
7970
try:
8071
avatar_path = persona.defaults.avatar_path
81-
avatar_filename = os.path.basename(avatar_path)
82-
self.log.info(f"Persona {persona.name} avatar: {avatar_filename}")
83-
84-
if avatar_path and avatar_filename == filename:
72+
if avatar_path and os.path.basename(avatar_path) == filename:
8573
# Found a match, return the absolute path
8674
if os.path.exists(avatar_path):
87-
self.log.info(f"Match found: {avatar_path}")
8875
return avatar_path
8976
else:
9077
self.log.warning(f"Avatar file not found at path: {avatar_path}")
9178
except Exception as e:
9279
self.log.warning(f"Error checking avatar for persona {persona.name}: {e}")
9380
continue
9481

95-
self.log.warning(f"No avatar found for filename: {filename}")
9682
return None

0 commit comments

Comments
 (0)