watch_console
Watch the Unity console to filter and wait for specific log messages, errors, compilation results, or play mode changes. Retrieve new logs using an internal cursor.
Instructions
Monitors the Unity console for new logs with filtering and waiting capabilities. Perfect for recursive iteration - wait for specific messages, errors, or compilation results. Actions:
wait_for_message: Block until a message matching pattern appears (with timeout)
wait_for_error: Block until an error occurs (with timeout)
wait_for_silence: Block until no new logs for specified duration
wait_for_compilation: Block until scripts finish compiling
wait_for_play_mode: Block until play mode state changes
get_new_logs: Get logs since last check (uses internal cursor)
reset_cursor: Reset the log cursor to current position
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Watch action to perform | |
| logType | No | Type of logs to watch (default: all) | |
| maxLogs | No | Maximum number of logs to return (default: 100) | |
| pattern | No | Regex pattern to match in log messages | |
| timeout | No | Maximum time to wait in milliseconds (default: 30000, max: 300000) | |
| targetState | No | Target play mode state to wait for | |
| silenceDuration | No | Duration of silence to wait for in milliseconds (default: 1000) | |
| includeStackTrace | No | Include stack traces in returned logs |