Skip to content

Ignore [] brackets while capturing date with UNIFIED_DATE_TIMESTAMP #444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 22, 2025

Conversation

srilakshmikanthanp
Copy link
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
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

@Copilot 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
Contributor

kcpeppe commented Jun 10, 2025

Can you provide a matching test case into DateTimeStampTest?

@srilakshmikanthanp
Copy link
Contributor Author

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

@srilakshmikanthanp
Copy link
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.

3 participants