summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-06-14 01:38:50 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-13 15:52:30 -0400
commit7d755da3e2c20f8e157b88c9721d0a19fe52006e (patch)
treeb2286133ffa50f237e175e72390e485e9359f69e
parent77f85a701a1487539e1c54a4a7d7f92d58f99cc9 (diff)
downloadSMAPI-7d755da3e2c20f8e157b88c9721d0a19fe52006e.tar.gz
SMAPI-7d755da3e2c20f8e157b88c9721d0a19fe52006e.tar.bz2
SMAPI-7d755da3e2c20f8e157b88c9721d0a19fe52006e.zip
fix log parser failing for logs with dot-delimited time formats
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI.Web/Framework/LogParsing/LogParser.cs2
2 files changed, 2 insertions, 1 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 99e05016..f2e407f1 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -9,6 +9,7 @@ These changes have not been released yet.
* For the web UI:
* 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:
* `this.Monitor.Log` now defaults to the `Trace` log level instead of `Debug`.
diff --git a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
index 3f33c0c1..595e6b49 100644
--- a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
+++ b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
@@ -15,7 +15,7 @@ namespace StardewModdingAPI.Web.Framework.LogParsing
** Fields
*********/
/// <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>
private readonly Regex InfoLinePattern = new Regex(@"^SMAPI (?<apiVersion>.+) with Stardew Valley (?<gameVersion>.+) on (?<os>.+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);