-
Notifications
You must be signed in to change notification settings - Fork 116
feat: Add search_console_logs tool for Unity log searching #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add search_console_logs tool for Unity log searching #51
Conversation
…ementation - Add ConsoleLogServiceType enum with EventBased and Unity6Enhanced options - Implement ConsoleLogsServiceUnity6 using internal LogEntries API for better reliability - Add command line argument support (-mcpConsoleLogService) for runtime switching - Update McpUnityServer to dynamically select service based on settings and Unity version - Add UI controls in McpUnityEditorWindow with warning dialogs for internal API usage - Default to safe EventBased implementation, Unity6Enhanced only when explicitly selected - Add clear startup logging to identify which implementation is active 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ered values - Create LogEntryModeFlags.cs with Unity's internal mode flag constants - Add support for observed mode values from debugging: * Compiler warnings: 266240 (0x41000) * Compiler errors: 272384 (0x42800) * Shader errors: 262212 (0x40044) * Runtime warnings: 8405504 (0x804200) * Runtime errors: 8405248 (0x804100) - Update Unity6InternalAPIReference.md with complete documentation - Add conditional debug logging for future mode value discovery - Improve error/warning classification accuracy in Unity 6 implementation This enables proper filtering of shader errors, compile errors, and runtime exceptions that were previously misclassified as "Log" type. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Removed GetEffectiveConsoleLogService() method - Console log service now only configurable via Unity Editor settings UI - Simplified configuration as command-line args are not practical for Unity Hub users 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Keep file locally but stop tracking it in git 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add SearchConsoleLogsTool.cs with keyword/regex search support - Support case-sensitive/insensitive search with logType filtering - Include pagination (offset/limit) and optional stack trace inclusion - Implement both C# (Unity) and TypeScript (Node.js) components - Register tool in McpUnityServer and Node.js MCP server - Remove previous resource-based implementation in favor of tool-based approach - Add comprehensive search capabilities: - Keyword search with partial matching - Regular expression pattern matching - Log type filtering (error/warning/info) - Configurable case sensitivity - Stack trace inclusion/exclusion for token optimization - Pagination support for large result sets 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis update introduces an advanced search capability for Unity console logs, allowing searches by keyword or regular expression with options for log type filtering, case sensitivity, stack trace inclusion, and pagination. It adds a Unity 6-specific log service, new tool registration, UI for service selection, and supporting documentation and metadata. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MCP Unity Editor
participant McpUnityServer
participant IConsoleLogsService
participant ConsoleLogsServiceUnity6
User->>MCP Unity Editor: Selects log service type (UI)
MCP Unity Editor->>McpUnityServer: Save setting, prompt for restart
User->>McpUnityServer: Request searchConsoleLogs tool
McpUnityServer->>IConsoleLogsService: SearchLogsAsJson(keyword, regex, logType, ...)
alt Unity6Enhanced selected and Unity 6+
IConsoleLogsService->>ConsoleLogsServiceUnity6: Perform internal API search
ConsoleLogsServiceUnity6-->>IConsoleLogsService: Return search results as JSON
else EventBased or fallback
IConsoleLogsService->>ConsoleLogsService: Perform event-based search
ConsoleLogsService-->>IConsoleLogsService: Return search results as JSON
end
IConsoleLogsService-->>McpUnityServer: Return search results
McpUnityServer-->>User: Return search results
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (19)
✨ Finishing Touches
🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary
Add comprehensive Unity console log search functionality as an MCP tool, providing powerful search capabilities for Unity developers using Claude Code and other MCP clients.
🔍 Features Added
Core Search Capabilities
Implementation Details
Enhanced Console Log Service
ConsoleLogServiceType
enum withEventBased
(default, safe) andUnity6Enhanced
(experimental) optionsLogEntry Mode Flags Support
LogEntryModeFlags.cs
with Unity's internal mode flag constantsUnity6InternalAPIReference.md
with complete API documentation🧪 Testing Results
All search functionality has been thoroughly tested:
shader
,texture
,Player
GameObject.*not found
,^\[MCP\].*
📋 Usage Examples
🎯 Benefits
This tool significantly enhances the Unity development experience when using Claude Code for debugging and log analysis.
🤖 Generated with Claude Code
Created with Palmier
Summary by CodeRabbit
New Features
Improvements
Documentation
Chores