feat: add console output file option for debugging and monitoring

Add comprehensive console logging to file functionality:
- CLI option --console-output-file to specify output file path
- Environment variable PLAYWRIGHT_MCP_CONSOLE_OUTPUT_FILE support
- Session configuration via browser_configure_snapshots tool
- Real-time structured logging with timestamp, session ID, and URL
- Automatic directory creation and graceful error handling
- Captures all console message types (log, error, warn, page errors)

Useful for debugging browser interactions and monitoring console activity
during automated sessions.
This commit is contained in:
Ryan Malloy 2025-08-24 14:12:00 -06:00
parent ec8b0c24b5
commit 7de63b5bab
6 changed files with 64 additions and 2 deletions

7
config.d.ts vendored
View file

@ -143,4 +143,11 @@ export type Config = {
* Default is false.
*/
differentialSnapshots?: boolean;
/**
* File path to write browser console output to. When specified, all console
* messages from browser pages will be written to this file in real-time.
* Useful for debugging and monitoring browser activity.
*/
consoleOutputFile?: string;
};