aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-08-29 19:11:38 -0500
committerJP Dillingham <jp@dillingham.me>2026-08-29 19:11:38 -0500
commitec02691a206451e9e9c11a2f305ab928c6f9676b (patch)
treeaf027e921b835217c7ac915211ced95b02fa4d4a /src
parent216c8ab2bcf84c2e11b8fa6fa640a9fdaa37f472 (diff)
downloadslskd-ec02691a206451e9e9c11a2f305ab928c6f9676b.tar.gz
add regex for parsing log lines
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Core/API/Controllers/LogsController.cs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/slskd/Core/API/Controllers/LogsController.cs b/src/slskd/Core/API/Controllers/LogsController.cs
index a35c6097..fff5e843 100644
--- a/src/slskd/Core/API/Controllers/LogsController.cs
+++ b/src/slskd/Core/API/Controllers/LogsController.cs
@@ -35,6 +35,7 @@ namespace slskd.Core.API
using System;
using System.Collections.Generic;
using System.IO;
+ using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Asp.Versioning;
@@ -61,6 +62,7 @@ namespace slskd.Core.API
private FileService Files { get; }
private ILogger Log { get; } = Serilog.Log.ForContext<ApplicationController>();
+ private Regex LogLineParseRegex { get; } = new Regex(@"^(\[?([a-zA-Z\.]*)\]?\s)?(\[((\d{4}-\d{2}-\d{2})T)?(\d{2}:\d{2}:\d{2}(?:.\d{3})?)\s([A-Z]+)\]\s)?(.*)", RegexOptions.Compiled);
/// <summary>
/// Gets the last few application logs.