changed the diagnose to be easier to use

This commit is contained in:
mxritzdev
2025-05-14 20:13:24 +02:00
parent 609a0297d5
commit ebc1b9441e
12 changed files with 193 additions and 219 deletions

View File

@@ -0,0 +1,24 @@
using System.IO.Compression;
using System.Text;
using MoonCore.Helpers;
using Moonlight.ApiServer.Extensions;
using Moonlight.ApiServer.Interfaces;
namespace Moonlight.ApiServer.Implementations.Diagnose;
public class LogsDiagnoseProvider : IDiagnoseProvider
{
public async Task ModifyZipArchive(ZipArchive archive)
{
var logs = await File.ReadAllTextAsync(PathBuilder.File("storage", "logs", "latest.log"));
if (string.IsNullOrEmpty(logs))
{
await archive.AddText("logs.txt", "Could not read the logs");
return;
}
await archive.AddText("logs.txt", logs);
}
}