fix log parser failing for logs with dot-delimited time formats

This commit is contained in:
Jesse Plamondon-Willard 2019-06-14 01:38:50 -04:00
parent 77f85a701a
commit 7d755da3e2
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ These changes have not been released yet.
* For the web UI: * For the web UI:
* When filtering the mod list, clicking a mod link now automatically adds it to the visible mods. * When filtering the mod list, clicking a mod link now automatically adds it to the visible mods.
* Fixed log parser failing in some cases due to time format localisation.
* For modders: * For modders:
* `this.Monitor.Log` now defaults to the `Trace` log level instead of `Debug`. * `this.Monitor.Log` now defaults to the `Trace` log level instead of `Debug`.

View File

@ -15,7 +15,7 @@ namespace StardewModdingAPI.Web.Framework.LogParsing
** Fields ** Fields
*********/ *********/
/// <summary>A regex pattern matching the start of a SMAPI message.</summary> /// <summary>A regex pattern matching the start of a SMAPI message.</summary>
private readonly Regex MessageHeaderPattern = new Regex(@"^\[(?<time>\d\d:\d\d:\d\d) (?<level>[a-z]+) +(?<modName>[^\]]+)\] ", RegexOptions.Compiled | RegexOptions.IgnoreCase); private readonly Regex MessageHeaderPattern = new Regex(@"^\[(?<time>\d\d[:\.]\d\d[:\.]\d\d) (?<level>[a-z]+) +(?<modName>[^\]]+)\] ", RegexOptions.Compiled | RegexOptions.IgnoreCase);
/// <summary>A regex pattern matching SMAPI's initial platform info message.</summary> /// <summary>A regex pattern matching SMAPI's initial platform info message.</summary>
private readonly Regex InfoLinePattern = new Regex(@"^SMAPI (?<apiVersion>.+) with Stardew Valley (?<gameVersion>.+) on (?<os>.+)", RegexOptions.Compiled | RegexOptions.IgnoreCase); private readonly Regex InfoLinePattern = new Regex(@"^SMAPI (?<apiVersion>.+) with Stardew Valley (?<gameVersion>.+) on (?<os>.+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);