AgentSkillsCN

uloop-get-logs

获取 Unity 控制台输出,包括错误、警告以及 Debug.Log 日志信息。在以下场景中使用:(1) 在代码变更后检查编译错误或运行时异常;(2) 查看执行过程中 Debug.Log 输出的内容;(3) 定位 NullReferenceException、MissingComponentException 等错误信息;(4) 探究 Unity 编辑器中某项操作失败的原因。

SKILL.md
--- frontmatter
name: uloop-get-logs
description: "Get Unity Console output including errors, warnings, and Debug.Log messages. Use when you need to: (1) Check for compile errors or runtime exceptions after code changes, (2) See what Debug.Log printed during execution, (3) Find NullReferenceException, MissingComponentException, or other error messages, (4) Investigate why something failed in Unity Editor."

uloop get-logs

Retrieve logs from Unity Console.

Usage

bash
uloop get-logs [options]

Parameters

ParameterTypeDefaultDescription
--log-typestringAllLog type filter: Error, Warning, Log, All
--max-countinteger100Maximum number of logs to retrieve
--search-textstring-Text to search within logs
--include-stack-tracebooleanfalseInclude stack trace in output
--use-regexbooleanfalseUse regex for search
--search-in-stack-tracebooleanfalseSearch within stack trace

Examples

bash
# Get all logs
uloop get-logs

# Get only errors
uloop get-logs --log-type Error

# Search for specific text
uloop get-logs --search-text "NullReference"

# Regex search
uloop get-logs --search-text "Missing.*Component" --use-regex

Output

Returns JSON array of log entries with message, type, and optional stack trace.