home / skills / besty0728 / unity-skills / console
/unity-skills/skills/console
This skill captures and manages Unity console logs, enabling quick filtering, retrieval, and custom logging to streamline debugging.
npx playbooks add skill besty0728/unity-skills --skill consoleReview the files below or copy the command above to add this skill to your agents.
---
name: unity-console
description: "Capture and manage Unity console logs."
---
# Unity Console Skills
Work with the Unity console - capture logs, write messages, and debug your project.
## Skills Overview
| Skill | Description |
|-------|-------------|
| `console_start_capture` | Start capturing logs |
| `console_stop_capture` | Stop capturing logs |
| `console_get_logs` | Get captured logs |
| `console_clear` | Clear console |
| `console_log` | Write log message |
---
## Skills
### console_start_capture
Start capturing Unity console logs.
No parameters.
### console_stop_capture
Stop capturing logs.
No parameters.
### console_get_logs
Get captured logs with optional filtering.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `filter` | string | No | null | Log/Warning/Error |
| `limit` | int | No | 100 | Max results |
**Returns**: `{success, totalLogs, logs: [{type, message, timestamp}]}`
### console_clear
Clear the Unity console.
No parameters.
### console_log
Write a custom log message.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `message` | string | Yes | - | Log message |
| `type` | string | No | "Log" | Log/Warning/Error |
---
## Example Usage
```python
import unity_skills
# Start capturing logs before play mode
unity_skills.call_skill("console_start_capture")
# Enter play mode
unity_skills.call_skill("editor_play")
# ... gameplay generates logs ...
unity_skills.call_skill("editor_stop")
# Get all captured logs
logs = unity_skills.call_skill("console_get_logs")
for log in logs['logs']:
print(f"[{log['type']}] {log['message']}")
# Get only errors
errors = unity_skills.call_skill("console_get_logs", filter="Error")
if errors['totalLogs'] > 0:
print(f"Found {errors['totalLogs']} errors!")
# Write custom log
unity_skills.call_skill("console_log",
message="AI Agent: Task completed",
type="Log"
)
# Write warning
unity_skills.call_skill("console_log",
message="AI Agent: Performance issue detected",
type="Warning"
)
# Clear and stop
unity_skills.call_skill("console_clear")
unity_skills.call_skill("console_stop_capture")
```
## Best Practices
1. Start capture before play mode for runtime logs
2. Filter by Error to quickly find problems
3. Use custom logs to mark AI agent actions
4. Clear console before starting new capture session
5. Stop capture when done to free resources
This skill captures and manages Unity console logs to help you monitor runtime behavior and troubleshoot issues. It provides commands to start and stop log capture, query captured entries with filters and limits, write custom log messages, and clear the console. Use it to collect targeted logs during play mode and to mark important AI agent actions programmatically.
The skill hooks into Unity's logging system and records messages emitted while capture is active. You can start and stop capture sessions, then retrieve stored logs with optional filtering by type (Log, Warning, Error) and a result limit. It also supports sending custom log entries into the console and clearing the console buffer when needed.
What log types can I filter by?
You can filter by Log, Warning, or Error. If no filter is provided, all types are returned.
How many logs are returned by default?
The default limit is 100 entries; you can increase or decrease this via the limit parameter.