From a619b4b2451dafb52217b25716de683a96c7ef0d Mon Sep 17 00:00:00 2001 From: LumaLivy Date: Sun, 7 Nov 2021 17:11:33 -0500 Subject: [PATCH] Ignore mystery exception on windows --- ProjectLighthouse/Logging/LighthouseFileLogger.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ProjectLighthouse/Logging/LighthouseFileLogger.cs b/ProjectLighthouse/Logging/LighthouseFileLogger.cs index 4b0e08a4..387ca881 100644 --- a/ProjectLighthouse/Logging/LighthouseFileLogger.cs +++ b/ProjectLighthouse/Logging/LighthouseFileLogger.cs @@ -20,8 +20,13 @@ namespace LBPUnion.ProjectLighthouse.Logging string contentFile = $"{channel}{line.LineData}\n"; string contentAll = $"[{$"{line.LoggerLevel.Name} {channel}".TrimEnd()}] {line.LineData}\n"; - File.AppendAllText(Path.Combine(logsDirectory, line.LoggerLevel.Name.ToFileName() + ".log"), contentFile); - File.AppendAllText(Path.Combine(logsDirectory, "all.log"), contentAll); + try + { + File.AppendAllText(Path.Combine(logsDirectory, line.LoggerLevel.Name.ToFileName() + ".log"), contentFile); + File.AppendAllText(Path.Combine(logsDirectory, "all.log"), contentAll); + } + catch (IOException) { } // windows, ya goofed + } } } \ No newline at end of file