Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/prehistoric-fluffy-sturgeon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stagehand": patch
---

Fix AttributeError crash from calling nonexistent `warning` method on StagehandLogger
2 changes: 1 addition & 1 deletion stagehand/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ async def handle_with_lock():
category="context",
)
else:
self.stagehand.logger.warning(
self.stagehand.logger.debug(
"Could not find StagehandPage wrapper for remaining page",
category="context",
)
Expand Down
4 changes: 2 additions & 2 deletions stagehand/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ async def init(self):
)
self.logger.debug("Set up CDP download behavior")
except Exception as e:
self.logger.warning(f"Failed to set up CDP download behavior: {str(e)}")
self.logger.debug(f"Failed to set up CDP download behavior: {str(e)}")

self._initialized = True

Expand Down Expand Up @@ -618,7 +618,7 @@ async def close(self):
f"Error ending server session {self.session_id}: {str(e)}"
)
elif self.session_id:
self.logger.warning(
self.logger.debug(
"Cannot end server session: HTTP client not available."
)

Expand Down
2 changes: 1 addition & 1 deletion stagehand/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async def ensure_injection(self):
# Ensure that the script is injected on future navigations
await self._page.add_init_script(_INJECTION_SCRIPT)
except TargetClosedError as e:
self._stagehand.logger.warning(
self._stagehand.logger.debug(
f"ensure_injection failed (page may be navigating): {e}",
category="page",
)
Expand Down
Loading