fix(logs): match log filters case-insensitively, message as a substring - #483
Open
mobile-kevin wants to merge 1 commit into
Open
mobile-kevin wants to merge 1 commit into
mobile-kevin wants to merge 1 commit into
Conversation
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.
|
Warning Review limit reached
This review includes 3 billable files and costs up to $0.75. Or wait 49 minutes for your next included review. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Review configuration: ⚙️ Run configurationConfiguration used: Repository: mobile-next/mobilecli/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
device logsfilter matching was exact and case-sensitive, so the obvious filters silently matched nothing:--filter level=errornever 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
--limitset, a filter that matches nothing streams forever waiting for entries that never arrive, which reads as a hang.Fix
strings.EqualFold).messageas a case-insensitive substring.Tests
level=error/ERRORmatchError, case-insensitive exclude, case-insensitiveprocess, andmessagesubstring matching (case-insensitive, include + exclude).level=errorandmessage=<substring>now return matching entries promptly instead of hanging.