home / skills / besty0728 / unity-skills / console

console skill

/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 console

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.4 KB
---
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

Overview

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.

How this skill works

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.

When to use it

  • Start capture before entering play mode to collect runtime logs.
  • Query captured logs after a test run to inspect errors and warnings.
  • Filter by "Error" to quickly surface critical failures.
  • Insert custom logs to annotate AI agent decisions or checkpoints.
  • Clear the console before a new session to avoid noise in results.

Best practices

  • Always call start capture before running tasks that emit logs, and stop capture when finished to conserve resources.
  • Use the filter parameter (Log/Warning/Error) to narrow results and reduce noise.
  • Set a reasonable limit to avoid transferring excessively large log sets; increase only when needed for deep debugging.
  • Write structured custom messages to make automated parsing and search easier.
  • Clear the console at the start of a session to ensure captured data is relevant.

Example use cases

  • Start capture, run a gameplay scenario, then retrieve all logs to generate a test report.
  • Filter captured logs for "Error" to trigger automated alerts or bug reports.
  • Insert custom "AI Agent" logs to mark task start/completion for traceability in long runs.
  • Clear the console and start a fresh capture before each CI playtest to ensure clean results.
  • Collect logs across multiple play sessions to analyze intermittent issues and reproduce bugs.

FAQ

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.