Get console logs. Args: types: Log types to retrieve (e.g., ["error", "warning"]) count: Maximum number of logs to retrieve (None = all) format: Output format ("detailed" or "simple") include_stacktrace: Include stack traces in output (default
(
self,
types: list[str] | None = None,
count: int | None = None,
format: str = "detailed",
include_stacktrace: bool = False,
filter_text: str | None = None,
)
| 15 | self._conn = conn |
| 16 | |
| 17 | def get( |
| 18 | self, |
| 19 | types: list[str] | None = None, |
| 20 | count: int | None = None, |
| 21 | format: str = "detailed", |
| 22 | include_stacktrace: bool = False, |
| 23 | filter_text: str | None = None, |
| 24 | ) -> dict[str, Any]: |
| 25 | """Get console logs. |
| 26 | |
| 27 | Args: |
| 28 | types: Log types to retrieve (e.g., ["error", "warning"]) |
| 29 | count: Maximum number of logs to retrieve (None = all) |
| 30 | format: Output format ("detailed" or "simple") |
| 31 | include_stacktrace: Include stack traces in output (default: False) |
| 32 | filter_text: Text to filter logs by |
| 33 | |
| 34 | Returns: |
| 35 | Dictionary containing console logs |
| 36 | """ |
| 37 | params: dict[str, Any] = { |
| 38 | "action": "read", |
| 39 | "format": format, |
| 40 | "include_stacktrace": include_stacktrace, |
| 41 | } |
| 42 | if types: |
| 43 | params["types"] = types |
| 44 | if count is not None: |
| 45 | params["count"] = count |
| 46 | if filter_text: |
| 47 | params["search"] = filter_text |
| 48 | |
| 49 | return self._conn.send_request("console", params) |
| 50 | |
| 51 | def clear(self) -> dict[str, Any]: |
| 52 | """Clear console logs. |