-
Notifications
You must be signed in to change notification settings - Fork 1.2k
effective logger #1260
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
base: main
Are you sure you want to change the base?
effective logger #1260
Conversation
|
Greptile OverviewGreptile SummaryThis PR systematically replaces inconsistent logging practices ( Key Changes
All error logs now include structured auxiliary data with error messages, stack traces, and relevant context for better debuggability. Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Handler as v3CuaAgentHandler
participant Client as AgentClient (Anthropic/Google/OpenAI)
participant Action as Action Methods
participant Screenshot as captureScreenshot
participant Logger as Structured Logger
Handler->>Client: execute(options)
Note over Handler,Client: Pass logger to client
Client->>Action: getAction(inputItems, logger)
Note over Action: Was: console.error()<br/>Now: logger({category, message, level})
Action-->>Logger: Log errors with stack trace
Action-->>Logger: Log warnings with context
Client->>Action: convertToolUseToAction(item, logger)
Note over Action: Convert tool calls to actions
Action-->>Logger: Log unknown tools, missing actions
Client->>Screenshot: captureScreenshot(logger, options)
Note over Screenshot: First param is now logger
Screenshot-->>Logger: Log screenshot errors
Handler->>Client: captureScreenshot(this.logger, {...})
Note over Handler,Client: Handler passes its logger instance
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
15 files reviewed, no comments
Why
Improved logging consistency and debuggability across the Stagehand codebase (STG-907). The codebase had inconsistent logging practices with many
console.log, console.error, and console.warn calls that weren't properly integrated with Stagehand's logging system. Additionally, several silent
error catches made debugging difficult.
What Changed
Agent Clients (Anthropic, Google, OpenAI CUA)
Error Handling Improvements
Debugging Improvements
AI SDK Client
Eval Tasks
Test Plan