Skip to content

Ignore [] brackets while capturing date with UNIFIED_DATE_TIMESTAMP#444

Merged
karianna merged 2 commits intomicrosoft:mainfrom
srilakshmikanthanp:date-capture-fix
Jun 22, 2025
Merged

Ignore [] brackets while capturing date with UNIFIED_DATE_TIMESTAMP#444
karianna merged 2 commits intomicrosoft:mainfrom
srilakshmikanthanp:date-capture-fix

Conversation

@srilakshmikanthanp
Copy link
Copy Markdown
Contributor

Hi,
I made a small fix that addresses the DateTimeParseException (#442) when parsing GC logs with RotatingGCLogFile. I’m not deeply familiar with GC internals or GC log formats, so this change is based on my understanding of the related code.
Please review and advise if any improvements are needed.
Thanks!

Copy link
Copy Markdown
Member

@karianna karianna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial pass - this looks OK, but given this class is at the heart of DateTime parsing for logs I'm going to run it through some manual regression testing also (See if there are logs without the [.

@karianna karianna requested a review from Copilot May 29, 2025 10:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a DateTimeParseException when parsing GC logs by adjusting the regex used to capture dates.

  • Updated DATE_TAG regex to include an additional capturing group for the date
  • Revised the capture group indexes for unified and pre-unified tokens in fromGCLogLine()

@kcpeppe
Copy link
Copy Markdown
Contributor

kcpeppe commented Jun 10, 2025

Can you provide a matching test case into DateTimeStampTest?

@srilakshmikanthanp
Copy link
Copy Markdown
Contributor Author

Hi @kcpeppe, I've added the unit test. Please review and let me know if any changes are needed.

@srilakshmikanthanp
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@karianna karianna merged commit b59f458 into microsoft:main Jun 22, 2025
8 checks passed
@srilakshmikanthanp srilakshmikanthanp deleted the date-capture-fix branch June 23, 2025 01:56
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.

4 participants