fix: file logger exception handling

This commit is contained in:
2026-04-18 17:52:21 +03:00
parent 6df3df1c3b
commit ce3e46948f

View File

@@ -19,12 +19,22 @@ public class FileLogger : LoggerBase
}
private async Task WriteLogs()
{
try
{
while (lineQueue.TryDequeue(out string? line))
await File.AppendAllTextAsync(FilePath, $"{line}{Environment.NewLine}");
}
catch (Exception e)
{
ILogger.Shared.LogException(this, e);
throw;
}
finally
{
currentWriteTask = null;
}
}
public FileLogger(string filePath)
{