[FIX] Save new Exception Format

This commit is contained in:
XorogVEVO 2022-04-09 16:13:28 +02:00
parent fad4c4598a
commit 52dcf19479
Signed by untrusted user who does not match committer: Xorog
GPG key ID: 983798ED9C3E7C36

View file

@ -57,7 +57,7 @@ public class Logger : ILogger
catch (Exception ex)
{
if (!ThrowOnFailedDeletion)
LogError( $"Couldn't delete log file {b}: {ex}");
LogError( $"Couldn't delete log file {b}", ex);
else
throw new Exception($"Failed to delete {b}: {ex}");
}
@ -211,7 +211,7 @@ public class Logger : ILogger
try
{
Byte[] FileWrite = Encoding.UTF8.GetBytes($"[{b.TimeOfEvent:dd.MM.yyyy HH:mm:ss}] [{LogLevelText}] {LogMessage}\n");
Byte[] FileWrite = Encoding.UTF8.GetBytes($"[{b.TimeOfEvent:dd.MM.yyyy HH:mm:ss}] [{LogLevelText}] {LogMessage}\n{(b.Exception is not null ? $"{b.Exception.ToString()}\n" : "")}");
if (OpenedFile != null)
{
await OpenedFile.WriteAsync(FileWrite.AsMemory(0, FileWrite.Length));