loganalyzer icon indicating copy to clipboard operation
loganalyzer copied to clipboard

core: Use regex to parse OBS version

Open prgmitchell opened this issue 1 year ago • 2 comments

Description

Remove the wrongLines list in favor of using regex to target the specific version line. My regex is not great so there is a chance I am over simplifying it but this is what I have gotten to work through trial and error. I am happy to change the regex if a better option is presented but this covers all of the different cases in the logs that I was able to find.

Motivation and Context

This will allow for less maintenance in the future to prevent the analyzer from crashing if a new line is logged before the OBS version is that includes "OBS".

How Has This Been Tested?

Tested the following logs, all with various versions from different versions dating back to 0.0.1 on Linux. https://obsproject.com/logs/g9mDoXFJfiQvUsyH https://obsproject.com/logs/Oj9J1vvGlDykmesH https://obsproject.com/logs/ubenZ416XhbHkMO8 https://obsproject.com/logs/GCDHNloD7RwdZs_f https://obsproject.com/logs/Ua29dmO45t8vlsVS

These logs were not only picked for the different version numbers but also because they have instances of other checks that use the version string such as the 32-bit OBS on 64-bit windows check.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] I have included updates to all appropriate documentation.

prgmitchell avatar Jun 09 '24 01:06 prgmitchell

dating back to 0.0.1 on Linux.

Just a note that "0.0.1 on Linux" is usually just "someone didn't set a tag or version override". There was not actually a 0.0.1 version.

This seems okay, and I can't think of an OBS version string that doesn't match this pattern, but I'll need to think it over a bit more.

RytoEX avatar Jun 10 '24 22:06 RytoEX

Good to know, I just searched "old version" in the Discord and stumbled on a few of those when doing research for this.

prgmitchell avatar Jun 11 '24 01:06 prgmitchell