Skip to content

adjust log levels for act #764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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/smart-windows-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@browserbasehq/stagehand-lib": patch
---

set correct log level for caught errors in `act`
12 changes: 6 additions & 6 deletions lib/handlers/actHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class StagehandActHandler {
this.logger({
category: "action",
message: "Cannot execute ObserveResult with unsupported method",
level: 1,
level: 0,
auxiliary: {
error: {
value:
Expand Down Expand Up @@ -113,7 +113,7 @@ export class StagehandActHandler {
this.logger({
category: "action",
message: "Error performing act from an ObserveResult",
level: 1,
level: 0,
auxiliary: {
error: { value: err.message, type: "string" },
trace: { value: err.stack, type: "string" },
Expand All @@ -130,7 +130,7 @@ export class StagehandActHandler {
category: "action",
message:
"Error performing act from an ObserveResult. Reprocessing the page and trying again",
level: 1,
level: 0,
auxiliary: {
error: { value: err.message, type: "string" },
trace: { value: err.stack, type: "string" },
Expand All @@ -154,7 +154,7 @@ export class StagehandActHandler {
this.logger({
category: "action",
message: "Error performing act from an ObserveResult on fallback",
level: 1,
level: 0,
auxiliary: {
error: { value: err.message, type: "string" },
trace: { value: err.stack, type: "string" },
Expand Down Expand Up @@ -324,7 +324,7 @@ export class StagehandActHandler {
this.logger({
category: "action",
message: "chosen method is invalid",
level: 1,
level: 0,
auxiliary: {
method: { value: method, type: "string" },
},
Expand All @@ -340,7 +340,7 @@ export class StagehandActHandler {
this.logger({
category: "action",
message: "error performing method",
level: 1,
level: 0,
auxiliary: {
error: { value: e.message, type: "string" },
trace: { value: e.stack, type: "string" },
Expand Down
14 changes: 7 additions & 7 deletions lib/handlers/handlerUtils/actHandlerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export async function scrollToPreviousChunk(ctx: MethodHandlerContext) {
logger({
category: "action",
message: "error scrolling to previous chunk",
level: 1,
level: 0,
auxiliary: {
error: { value: e.message, type: "string" },
trace: { value: e.stack, type: "string" },
Expand Down Expand Up @@ -173,7 +173,7 @@ export async function scrollElementIntoView(ctx: MethodHandlerContext) {
logger({
category: "action",
message: "error scrolling element into view",
level: 1,
level: 0,
auxiliary: {
error: { value: e.message, type: "string" },
trace: { value: e.stack, type: "string" },
Expand Down Expand Up @@ -243,7 +243,7 @@ export async function scrollElementToPercentage(ctx: MethodHandlerContext) {
logger({
category: "action",
message: "error scrolling element vertically to percentage",
level: 1,
level: 0,
auxiliary: {
error: { value: e.message, type: "string" },
trace: { value: e.stack, type: "string" },
Expand All @@ -266,7 +266,7 @@ export async function fillOrType(ctx: MethodHandlerContext) {
logger({
category: "action",
message: "error filling element",
level: 1,
level: 0,
auxiliary: {
error: { value: e.message, type: "string" },
trace: { value: e.stack, type: "string" },
Expand Down Expand Up @@ -303,7 +303,7 @@ export async function pressKey(ctx: MethodHandlerContext) {
logger({
category: "action",
message: "error pressing key",
level: 1,
level: 0,
auxiliary: {
error: { value: e.message, type: "string" },
trace: { value: e.stack, type: "string" },
Expand Down Expand Up @@ -345,7 +345,7 @@ export async function clickElement(ctx: MethodHandlerContext) {
logger({
category: "action",
message: "error performing click",
level: 1,
level: 0,
auxiliary: {
error: { value: e.message, type: "string" },
trace: { value: e.stack, type: "string" },
Expand Down Expand Up @@ -392,7 +392,7 @@ export async function fallbackLocatorMethod(ctx: MethodHandlerContext) {
logger({
category: "action",
message: "error performing method",
level: 1,
level: 0,
auxiliary: {
error: { value: e.message, type: "string" },
trace: { value: e.stack, type: "string" },
Expand Down