fix: file logger exception handling
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user