Skip to content

fix(logs): match log filters case-insensitively, message as a substring - #483

Open
mobile-kevin wants to merge 1 commit into
mobile-next:mainfrom
mobile-kevin:fix-log-filter-matching
Open

mobile-kevin wants to merge 1 commit into
mobile-next:mainfrom
mobile-kevin:fix-log-filter-matching

Conversation

@mobile-kevin

Copy link
Copy Markdown
Contributor

Problem

device logs filter matching was exact and case-sensitive, so the obvious filters silently matched nothing:

  • --filter level=error never matched "Error" (and iOS/Android capitalize levels differently, so there was no portable spelling).
  • --filter message=<text> required the field to equal the whole log line, so a substring never matched.

With --limit set, a filter that matches nothing streams forever waiting for entries that never arrive, which reads as a hang.

Fix

  • Compare every field case-insensitively (strings.EqualFold).
  • Match message as a case-insensitive substring.
  • Help text documents both.

Tests

  • Unit: level=error/ERROR match Error, case-insensitive exclude, case-insensitive process, and message substring matching (case-insensitive, include + exclude).
  • Verified live: level=error and message=<substring> now return matching entries promptly instead of hanging.

Filter matching was exact and case-sensitive, so the natural filters silently
matched nothing: `level=error` never matched "Error" (iOS and Android also
capitalize levels differently), and `message=<text>` demanded the whole line
rather than a substring. With --limit set, a filter that matches nothing then
streams forever waiting for entries that never arrive.

Compare every field case-insensitively, and match `message` as a (case-
insensitive) substring. Help text updated.
@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 3 billable files and costs up to $0.75.

Or wait 49 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: mobile-next/mobilecli/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 1901a090-6725-430f-be46-681c8a32e723

📥 Commits

Reviewing files that changed from the base of the PR and between 1e88c68 and fd4383c.

📒 Files selected for processing (3)
  • cli/logs.go
  • commands/logs.go
  • commands/logs_test.go

Comment @coderabbitai help to get the list of available commands.

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