Repository navigation
Conversation
- Support log entries where message body is empty or has no trailing space after the tag colon - Preserve leading whitespace when message content is present - Add unit tests covering year and threadtime format with empty message bodies - Update CHANGELOG.md
todi1856
left a comment
There was a problem hiding this comment.
Sorry, but this code introduces some regressions
LogMessageRegexMatchesForThreadTimeFormat (0.002s)
---
Expected string length 28 but was 9. Strings differ at index 9.
Expected: "BarTender:BatteryStatsDumper"
But was: "BarTender"
LogMessageRegexMatchesForYearFormat (0.000s)
---
Expected string length 28 but was 9. Strings differ at index 9.
Expected: "BarTender:BatteryStatsDumper"
But was: "BarTender"
``
A second, smaller regression: a tab after the colon (tag:\thello) used to parse to msg=hello. Now it parses with an empty message, because \s was swapped for a literal space.
…cat regex - Use ':(?:\s(?<msg>.*)|$)' so colons in tags (e.g. BarTender:BatteryStatsDumper) continue matching correctly - Preserve \s whitespace delimiter support including tabs (\t) after the colon - Support empty log messages ending with colon or colon with trailing whitespace - Add unit tests for colons in tags with empty message and tab message delimiters
|
Hi @todi1856, Thank you for catching those regressions! Root Cause
ResolutionUpdated the regex suffix to:
Added unit test coverage in \AndroidLogcatRegexTests.cs\ for:
The commit has been pushed to this PR branch. |
todi1856
left a comment
There was a problem hiding this comment.
Also pls merge master to resolve conflict
| - Recordings can be played in the Screen Capture window, with play/pause, a time slider and buttons that step one frame back or forward. | ||
| - Tools->Open Terminal is now supported on Linux Editor. | ||
| - Fixed Tools->Open Terminal not opening a window on Windows Editor when running on CoreCLR. | ||
| - Fixed logcat regex parser failing on empty log messages or messages without a space after the tag colon. |
There was a problem hiding this comment.
I think this should say
Fixed log lines with an empty message not being parsed. They appeared as unformatted text with no tag, process ID or priority, and were hidden when filtering by tag.
since this PR doesn't fix "messages without a space after the tag colon." and if I I understand correctly, it can't be fixed
There was a problem hiding this comment.
Updated the CHANGELOG entry to the requested description and merged master to resolve the conflict.
|
Hi @todi1856, Merged
All commits have been pushed and the PR is ready for re-review! |
todi1856
left a comment
There was a problem hiding this comment.
Thank you for the fix ! Much appreciated
Purpose of this PR
Fixed logcat regex parsers (
m_LogCatEntryYearRegexandm_LogCatEntryThreadTimeRegex) failing to match log lines with an empty message body (e.g.tag:ortag:).Previously, the regex ended with
:\s(?<msg>.*), which required at least one whitespace character after the colon. When an Android logcat line had an empty message body without trailing spaces, the regex match failed, causing the line to be treated as an unparsable error entry (LogEntryParserErrorFor).This PR:
:(?:\s(?<msg>.*)|$), matching empty message bodies ending at the colon or with trailing whitespace, preserving any leading whitespace when message content is present, while correctly matching tags containing colons (e.g.BarTender:BatteryStatsDumper:).AndroidLogcatRegexTests.csverifying empty messages in both year and threadtime formats, tags with colons, and whitespace delimiters.CHANGELOG.md.Comments to Reviewers
All regex unit tests pass cleanly.