diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-08-29 19:13:02 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-08-29 19:13:02 -0500 |
| commit | 0ef9cd71e115642cce876372c76fd3a1d8de6a4b (patch) | |
| tree | ee169afa3f3ed250328a7d02064fb5a45062d53b /src/slskd/Core | |
| parent | e2bc14a1572c4a3d035ac7a4ffe47cff35fd2e16 (diff) | |
| download | slskd-0ef9cd71e115642cce876372c76fd3a1d8de6a4b.tar.gz | |
wip
Diffstat (limited to 'src/slskd/Core')
| -rw-r--r-- | src/slskd/Core/API/Controllers/LogsController.cs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/slskd/Core/API/Controllers/LogsController.cs b/src/slskd/Core/API/Controllers/LogsController.cs index 1c1f057b..1a3e027f 100644 --- a/src/slskd/Core/API/Controllers/LogsController.cs +++ b/src/slskd/Core/API/Controllers/LogsController.cs @@ -165,6 +165,7 @@ namespace slskd.Core.API var reader = new StreamReader(stream); string line; + Match match = default; while ((line = await reader.ReadLineAsync()) is not null) { @@ -251,14 +252,31 @@ namespace slskd.Core.API Level = level, Message = grp[8].Value, }); + + Log.Information("Added: {Text}", grp[8].Value); } catch (Exception ex) { - Log.Warning(ex, "Error parsing log message: {Message}", ex.Message); - continue; + Log.Debug("Error parsing log message: {Message}. Line: {Line}", ex.Message, line); + + Log.Warning("Got {GroupCount} groups", match.Groups.Count); + + foreach (var key in match.Groups.Keys) + { + Log.Warning("Key: {Key}, Success: {Success}, Value: {Value}", key, match.Groups[key].Success, match.Groups[key].Value); + } + + break; + + list.Add(new LogRecord + { + Message = line, + }); } } + Log.Information("Returned {Lines}", list.Count); + return list; } } |
