Skip to content

Add error log filtering capabilities#34

Open
cstosgale wants to merge 3 commits intovoska:masterfrom
cstosgale:master
Open

Add error log filtering capabilities#34
cstosgale wants to merge 3 commits intovoska:masterfrom
cstosgale:master

Conversation

@cstosgale
Copy link
Copy Markdown

Summary

This PR adds advanced filtering capabilities to the get_error_log tool, making it easier to troubleshoot Home Assistant issues efficiently.

Changes

1. Enhanced Error Log Filtering (app/hass.py, app/server.py)

Added four optional parameters to the get_error_log tool:

  • level: Filter by log level (ERROR, WARNING, INFO, DEBUG)
  • integration: Filter by integration name (e.g., 'mqtt', 'zwave')
  • search_term: Filter by keyword or phrase (case-insensitive)
  • lines: Limit number of lines returned (most recent N lines)

Benefits:

  • Improves token efficiency by returning only relevant log data
  • Filters can be combined for more precise results
  • Makes troubleshooting faster and more targeted

Example use cases:

  • level="ERROR" - Get only error entries
  • integration="mqtt", lines=50 - Get last 50 MQTT integration log entries
  • search_term="timeout", level="WARNING" - Get warnings containing "timeout"

2. Updated .gitignore

  • Added .claude/settings.local.json for Claude Code settings
  • Added uv.lock to exclude environment-specific lock files

3. Updated README Documentation

  • Added error log filtering to Features section
  • Included usage examples demonstrating filtering capabilities
  • Added dedicated Error Log Filtering section with parameters and examples

Testing

The changes have been tested with various filter combinations to ensure proper filtering and response formatting.

🤖 Generated with Claude Code

cstosgale and others added 3 commits October 4, 2025 17:52
- Added level, integration, search_term, and lines parameters to filter logs
- Filters can be combined for more precise results
- Returns total_lines and filters_applied in response
- Improves token efficiency by allowing targeted log queries

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Exclude uv.lock from version control as it contains environment-specific lock data that shouldn't be shared across different development environments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Added error log filtering to Features section
- Included usage examples for filtering logs
- Added detailed Error Log Filtering section with parameters and examples
- Documents the ability to filter by level, integration, search term, and line limit

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant