From a408e802d44b655ebf4bdba34b71aa89b3763303 Mon Sep 17 00:00:00 2001 From: Xjph Date: Mon, 7 Jun 2021 09:20:53 -0230 Subject: [PATCH] Use same process to determine journal path in JournalPoke method. --- ObservatoryCore/LogMonitor.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ObservatoryCore/LogMonitor.cs b/ObservatoryCore/LogMonitor.cs index a485236..9544f47 100644 --- a/ObservatoryCore/LogMonitor.cs +++ b/ObservatoryCore/LogMonitor.cs @@ -103,8 +103,6 @@ namespace Observatory #endregion - - #region Private Fields private FileSystemWatcher journalWatcher; @@ -137,7 +135,7 @@ namespace Observatory statusWatcher.Changed += StatusUpdateEvent; } - private DirectoryInfo GetJournalFolder(string path) + private DirectoryInfo GetJournalFolder(string path = "") { DirectoryInfo logDirectory; @@ -252,9 +250,10 @@ namespace Observatory { while (monitoring) { + var journalFolder = GetJournalFolder(); FileInfo fileToPoke = null; - foreach (var file in new DirectoryInfo(Properties.Core.Default.JournalFolder).GetFiles("Journal.????????????.??.log")) + foreach (var file in journalFolder.GetFiles("Journal.????????????.??.log")) { if (fileToPoke == null || string.Compare(file.Name, fileToPoke.Name) > 0) {