From 0b95c41108520bb5c1eded2986c702d4dc46e66c Mon Sep 17 00:00:00 2001 From: Serraniel Date: Sat, 2 Feb 2019 00:53:31 +0100 Subject: [PATCH] Automatically process queue --- SweetLib/Utils/Logger/Memory/ArchivableConsoleLogMemory.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SweetLib/Utils/Logger/Memory/ArchivableConsoleLogMemory.cs b/SweetLib/Utils/Logger/Memory/ArchivableConsoleLogMemory.cs index 9760959..978af50 100644 --- a/SweetLib/Utils/Logger/Memory/ArchivableConsoleLogMemory.cs +++ b/SweetLib/Utils/Logger/Memory/ArchivableConsoleLogMemory.cs @@ -18,6 +18,8 @@ namespace SweetLib.Utils.Logger.Memory public string ArchiveFile { get; set; } + public bool AutoProcessQueue { get; set; } = true; + public bool AutoArchiveOnDispose { get; set; } = true; public ArchivableConsoleLogMemory() : this(null) { } @@ -102,6 +104,9 @@ namespace SweetLib.Utils.Logger.Memory LogQueue.Enqueue(message); Console.ForegroundColor = consoleColor; + + if (AutoProcessQueue) + ProcessQueue(); } @@ -161,8 +166,6 @@ namespace SweetLib.Utils.Logger.Memory } catch (FileNotFoundException) { - if (disposing) - throw; } }