mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-04-05 17:39:39 -04:00
Add event-based LogMonitor state changes to better handle batch reads (#59)
* Add event-based LogMonitor state changes to better handle batch reads Pre-reading hackily used read-all to suppress notifications. But that broke some assumptions about what read-all meant. Furthermore, the Core UI told plugins about read-all rather than the log monitor telling them -- which is really what should be telling them. To address these concerns, LogMonitor now provides an event that both the PluginCore and PluginEventHandler listens to or tracking logging state allowing more granular information about the activities of LogMonitor, including distinguishing between ReadAll and Pre-read batches. Plugins no longer need to track if LogMonitor is in batch-read mode or not -- PluginCore now provides it. I've also converted all built-in plugins to use the new event-based system. The old system is marked deprecated and will go away once other known contributed plugins have converted to the new system. * Change LogMonitorState enum to [Flags], drop 'None' state As requested, and did associated simplifications and cleanup that followed.
This commit is contained in:
parent
7c54d6dd65
commit
4f4ba88878
@ -29,7 +29,6 @@ namespace Observatory.Botanist
|
|||||||
> BioPlanets;
|
> BioPlanets;
|
||||||
ObservableCollection<object> GridCollection;
|
ObservableCollection<object> GridCollection;
|
||||||
private PluginUI pluginUI;
|
private PluginUI pluginUI;
|
||||||
private bool readAllInProgress = false;
|
|
||||||
private Guid? samplerStatusNotification = null;
|
private Guid? samplerStatusNotification = null;
|
||||||
private BotanistSettings botanistSettings = new()
|
private BotanistSettings botanistSettings = new()
|
||||||
{
|
{
|
||||||
@ -102,7 +101,7 @@ namespace Observatory.Botanist
|
|||||||
{
|
{
|
||||||
case ScanOrganicType.Log:
|
case ScanOrganicType.Log:
|
||||||
case ScanOrganicType.Sample:
|
case ScanOrganicType.Sample:
|
||||||
if (!readAllInProgress && botanistSettings.OverlayEnabled)
|
if (!Core.IsLogMonitorBatchReading && botanistSettings.OverlayEnabled)
|
||||||
{
|
{
|
||||||
NotificationArgs args = new()
|
NotificationArgs args = new()
|
||||||
{
|
{
|
||||||
@ -171,22 +170,24 @@ namespace Observatory.Botanist
|
|||||||
Core = observatoryCore;
|
Core = observatoryCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReadAllStarted()
|
public void LogMonitorStateChanged(LogMonitorStateChangedEventArgs args)
|
||||||
{
|
{
|
||||||
readAllInProgress = true;
|
if (LogMonitorStateChangedEventArgs.IsBatchRead(args.NewState))
|
||||||
|
{
|
||||||
|
// Beginning a batch read. Clear grid.
|
||||||
Core.ClearGrid(this, new BotanistGrid());
|
Core.ClearGrid(this, new BotanistGrid());
|
||||||
}
|
}
|
||||||
|
else if (LogMonitorStateChangedEventArgs.IsBatchRead(args.PreviousState))
|
||||||
public void ReadAllFinished()
|
|
||||||
{
|
{
|
||||||
readAllInProgress = false;
|
// Batch read is complete. Show data.
|
||||||
UpdateUIGrid();
|
UpdateUIGrid();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void UpdateUIGrid()
|
private void UpdateUIGrid()
|
||||||
{
|
{
|
||||||
// Suppress repainting the entire contents of the grid on every ScanOrganic record we read.
|
// Suppress repainting the entire contents of the grid on every ScanOrganic record we read.
|
||||||
if (readAllInProgress) return;
|
if (Core.IsLogMonitorBatchReading) return;
|
||||||
|
|
||||||
BotanistGrid uiObject = new();
|
BotanistGrid uiObject = new();
|
||||||
Core.ClearGrid(this, uiObject);
|
Core.ClearGrid(this, uiObject);
|
||||||
|
@ -4,7 +4,6 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
using Observatory.Framework;
|
using Observatory.Framework;
|
||||||
using Observatory.Framework.Files;
|
using Observatory.Framework.Files;
|
||||||
|
|
||||||
@ -34,6 +33,7 @@ namespace Observatory
|
|||||||
currentLine = new();
|
currentLine = new();
|
||||||
journalTypes = JournalReader.PopulateEventClasses();
|
journalTypes = JournalReader.PopulateEventClasses();
|
||||||
InitializeWatchers(string.Empty);
|
InitializeWatchers(string.Empty);
|
||||||
|
SetLogMonitorState(LogMonitorState.Idle);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -50,7 +50,7 @@ namespace Observatory
|
|||||||
}
|
}
|
||||||
journalWatcher.EnableRaisingEvents = true;
|
journalWatcher.EnableRaisingEvents = true;
|
||||||
statusWatcher.EnableRaisingEvents = true;
|
statusWatcher.EnableRaisingEvents = true;
|
||||||
monitoring = true;
|
SetLogMonitorState(LogMonitorState.Realtime);
|
||||||
JournalPoke();
|
JournalPoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ namespace Observatory
|
|||||||
{
|
{
|
||||||
journalWatcher.EnableRaisingEvents = false;
|
journalWatcher.EnableRaisingEvents = false;
|
||||||
statusWatcher.EnableRaisingEvents = false;
|
statusWatcher.EnableRaisingEvents = false;
|
||||||
monitoring = false;
|
SetLogMonitorState(LogMonitorState.Idle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ChangeWatchedDirectory(string path)
|
public void ChangeWatchedDirectory(string path)
|
||||||
@ -70,12 +70,13 @@ namespace Observatory
|
|||||||
|
|
||||||
public bool IsMonitoring()
|
public bool IsMonitoring()
|
||||||
{
|
{
|
||||||
return monitoring;
|
return (currentState & LogMonitorState.Realtime) == LogMonitorState.Realtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(fredjk_gh): Remove?
|
||||||
public bool ReadAllInProgress()
|
public bool ReadAllInProgress()
|
||||||
{
|
{
|
||||||
return readall;
|
return LogMonitorStateChangedEventArgs.IsBatchRead(currentState);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReadAllJournals()
|
public void ReadAllJournals()
|
||||||
@ -87,7 +88,8 @@ namespace Observatory
|
|||||||
{
|
{
|
||||||
// Prevent pre-reading when starting monitoring after reading all.
|
// Prevent pre-reading when starting monitoring after reading all.
|
||||||
firstStartMonitor = false;
|
firstStartMonitor = false;
|
||||||
readall = true;
|
SetLogMonitorState(currentState | LogMonitorState.Batch);
|
||||||
|
|
||||||
DirectoryInfo logDirectory = GetJournalFolder(path);
|
DirectoryInfo logDirectory = GetJournalFolder(path);
|
||||||
var files = logDirectory.GetFiles("Journal.????????????.??.log");
|
var files = logDirectory.GetFiles("Journal.????????????.??.log");
|
||||||
var readErrors = new List<(Exception ex, string file, string line)>();
|
var readErrors = new List<(Exception ex, string file, string line)>();
|
||||||
@ -98,13 +100,15 @@ namespace Observatory
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReportErrors(readErrors);
|
ReportErrors(readErrors);
|
||||||
readall = false;
|
SetLogMonitorState(currentState & ~LogMonitorState.Batch);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PrereadJournals()
|
public void PrereadJournals()
|
||||||
{
|
{
|
||||||
if (!Properties.Core.Default.TryPrimeSystemContextOnStartMonitor) return;
|
if (!Properties.Core.Default.TryPrimeSystemContextOnStartMonitor) return;
|
||||||
|
|
||||||
|
SetLogMonitorState(currentState | LogMonitorState.PreRead);
|
||||||
|
|
||||||
DirectoryInfo logDirectory = GetJournalFolder(Properties.Core.Default.JournalFolder);
|
DirectoryInfo logDirectory = GetJournalFolder(Properties.Core.Default.JournalFolder);
|
||||||
var files = logDirectory.GetFiles("Journal.????????????.??.log");
|
var files = logDirectory.GetFiles("Journal.????????????.??.log");
|
||||||
|
|
||||||
@ -156,15 +160,16 @@ namespace Observatory
|
|||||||
linesToRead = lastSystemLines;
|
linesToRead = lastSystemLines;
|
||||||
}
|
}
|
||||||
|
|
||||||
readall = true;
|
|
||||||
ReportErrors(ProcessLines(linesToRead, "Pre-read"));
|
ReportErrors(ProcessLines(linesToRead, "Pre-read"));
|
||||||
readall = false;
|
SetLogMonitorState(currentState & ~LogMonitorState.PreRead);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Public Events
|
#region Public Events
|
||||||
|
|
||||||
|
public event EventHandler<LogMonitorStateChangedEventArgs> LogMonitorStateChanged;
|
||||||
|
|
||||||
public event EventHandler<JournalEventArgs> JournalEntry;
|
public event EventHandler<JournalEventArgs> JournalEntry;
|
||||||
|
|
||||||
public event EventHandler<JournalEventArgs> StatusUpdate;
|
public event EventHandler<JournalEventArgs> StatusUpdate;
|
||||||
@ -177,14 +182,27 @@ namespace Observatory
|
|||||||
private FileSystemWatcher statusWatcher;
|
private FileSystemWatcher statusWatcher;
|
||||||
private Dictionary<string, Type> journalTypes;
|
private Dictionary<string, Type> journalTypes;
|
||||||
private Dictionary<string, int> currentLine;
|
private Dictionary<string, int> currentLine;
|
||||||
|
private LogMonitorState currentState = LogMonitorState.Idle; // Change via #SetLogMonitorState
|
||||||
private bool monitoring = false;
|
private bool monitoring = false;
|
||||||
private bool readall = false;
|
|
||||||
private bool firstStartMonitor = true;
|
private bool firstStartMonitor = true;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
|
private void SetLogMonitorState(LogMonitorState newState)
|
||||||
|
{
|
||||||
|
var oldState = currentState;
|
||||||
|
currentState = newState;
|
||||||
|
LogMonitorStateChanged?.Invoke(this, new LogMonitorStateChangedEventArgs
|
||||||
|
{
|
||||||
|
PreviousState = oldState,
|
||||||
|
NewState = newState
|
||||||
|
});;
|
||||||
|
|
||||||
|
System.Diagnostics.Debug.WriteLine("LogMonitor State change: {0} -> {1}", oldState, newState);
|
||||||
|
}
|
||||||
|
|
||||||
private void InitializeWatchers(string path)
|
private void InitializeWatchers(string path)
|
||||||
{
|
{
|
||||||
DirectoryInfo logDirectory = GetJournalFolder(path);
|
DirectoryInfo logDirectory = GetJournalFolder(path);
|
||||||
|
@ -11,6 +11,7 @@ namespace Observatory.PluginManagement
|
|||||||
|
|
||||||
private readonly NativeVoice NativeVoice;
|
private readonly NativeVoice NativeVoice;
|
||||||
private readonly NativePopup NativePopup;
|
private readonly NativePopup NativePopup;
|
||||||
|
private LogMonitorState currentLogMonitorState = LogMonitorState.Idle;
|
||||||
|
|
||||||
public PluginCore()
|
public PluginCore()
|
||||||
{
|
{
|
||||||
@ -18,6 +19,11 @@ namespace Observatory.PluginManagement
|
|||||||
NativePopup = new();
|
NativePopup = new();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void OnLogMonitorStateChanged(object sender, LogMonitorStateChangedEventArgs e)
|
||||||
|
{
|
||||||
|
currentLogMonitorState = e.NewState;
|
||||||
|
}
|
||||||
|
|
||||||
public string Version => System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString();
|
public string Version => System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString();
|
||||||
|
|
||||||
public Status GetStatus()
|
public Status GetStatus()
|
||||||
@ -34,7 +40,7 @@ namespace Observatory.PluginManagement
|
|||||||
{
|
{
|
||||||
var guid = Guid.Empty;
|
var guid = Guid.Empty;
|
||||||
|
|
||||||
if (!LogMonitor.GetInstance.ReadAllInProgress())
|
if (!IsLogMonitorBatchReading)
|
||||||
{
|
{
|
||||||
if (notificationArgs.Rendering.HasFlag(NotificationRendering.PluginNotifier))
|
if (notificationArgs.Rendering.HasFlag(NotificationRendering.PluginNotifier))
|
||||||
{
|
{
|
||||||
@ -63,7 +69,7 @@ namespace Observatory.PluginManagement
|
|||||||
|
|
||||||
public void UpdateNotification(Guid id, NotificationArgs notificationArgs)
|
public void UpdateNotification(Guid id, NotificationArgs notificationArgs)
|
||||||
{
|
{
|
||||||
if (!LogMonitor.GetInstance.ReadAllInProgress())
|
if (!IsLogMonitorBatchReading)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (notificationArgs.Rendering.HasFlag(NotificationRendering.PluginNotifier))
|
if (notificationArgs.Rendering.HasFlag(NotificationRendering.PluginNotifier))
|
||||||
@ -134,6 +140,16 @@ namespace Observatory.PluginManagement
|
|||||||
get => Observatory.HttpClient.Client;
|
get => Observatory.HttpClient.Client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LogMonitorState CurrentLogMonitorState
|
||||||
|
{
|
||||||
|
get => currentLogMonitorState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsLogMonitorBatchReading
|
||||||
|
{
|
||||||
|
get => LogMonitorStateChangedEventArgs.IsBatchRead(currentLogMonitorState);
|
||||||
|
}
|
||||||
|
|
||||||
public event EventHandler<NotificationArgs> Notification;
|
public event EventHandler<NotificationArgs> Notification;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,21 @@ namespace Observatory.PluginManagement
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void OnLogMonitorStateChanged(object sender, LogMonitorStateChangedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (var worker in observatoryWorkers)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
worker.LogMonitorStateChanged(e);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
RecordError(ex, worker.Name, "LogMonitorStateChanged event");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void OnNotificationEvent(object source, NotificationArgs notificationArgs)
|
public void OnNotificationEvent(object source, NotificationArgs notificationArgs)
|
||||||
{
|
{
|
||||||
foreach (var notifier in observatoryNotifiers)
|
foreach (var notifier in observatoryNotifiers)
|
||||||
|
@ -46,8 +46,10 @@ namespace Observatory.PluginManagement
|
|||||||
|
|
||||||
logMonitor.JournalEntry += pluginHandler.OnJournalEvent;
|
logMonitor.JournalEntry += pluginHandler.OnJournalEvent;
|
||||||
logMonitor.StatusUpdate += pluginHandler.OnStatusUpdate;
|
logMonitor.StatusUpdate += pluginHandler.OnStatusUpdate;
|
||||||
|
logMonitor.LogMonitorStateChanged += pluginHandler.OnLogMonitorStateChanged;
|
||||||
|
|
||||||
var core = new PluginCore();
|
var core = new PluginCore();
|
||||||
|
logMonitor.LogMonitorStateChanged += core.OnLogMonitorStateChanged;
|
||||||
|
|
||||||
List<IObservatoryPlugin> errorPlugins = new();
|
List<IObservatoryPlugin> errorPlugins = new();
|
||||||
|
|
||||||
|
@ -65,8 +65,10 @@ namespace Observatory.UI.ViewModels
|
|||||||
|
|
||||||
public void ReadAll()
|
public void ReadAll()
|
||||||
{
|
{
|
||||||
|
// TODO(fredjk_gh): remove.
|
||||||
SetWorkerReadAllState(true);
|
SetWorkerReadAllState(true);
|
||||||
LogMonitor.GetInstance.ReadAllJournals();
|
LogMonitor.GetInstance.ReadAllJournals();
|
||||||
|
// TODO(fredjk_gh): remove.
|
||||||
SetWorkerReadAllState(false);
|
SetWorkerReadAllState(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,8 +84,10 @@ namespace Observatory.UI.ViewModels
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// HACK: Find a better way of suppressing notifications when pre-reading.
|
// HACK: Find a better way of suppressing notifications when pre-reading.
|
||||||
|
// TODO(fredjk_gh): remove.
|
||||||
SetWorkerReadAllState(true);
|
SetWorkerReadAllState(true);
|
||||||
logMonitor.Start();
|
logMonitor.Start();
|
||||||
|
// TODO(fredjk_gh): remove.
|
||||||
SetWorkerReadAllState(false);
|
SetWorkerReadAllState(false);
|
||||||
ToggleButtonText = "Stop Monitor";
|
ToggleButtonText = "Stop Monitor";
|
||||||
}
|
}
|
||||||
@ -138,6 +142,7 @@ namespace Observatory.UI.ViewModels
|
|||||||
get { return tabs; }
|
get { return tabs; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(fredjk_gh): remove.
|
||||||
private void SetWorkerReadAllState(bool isReadingAll)
|
private void SetWorkerReadAllState(bool isReadingAll)
|
||||||
{
|
{
|
||||||
foreach (var worker in workers)
|
foreach (var worker in workers)
|
||||||
|
@ -34,8 +34,7 @@ namespace Observatory.Explorer
|
|||||||
private ObservableCollection<object> resultsGrid;
|
private ObservableCollection<object> resultsGrid;
|
||||||
private IObservatoryCore Core;
|
private IObservatoryCore Core;
|
||||||
|
|
||||||
private bool readAllStarting = false;
|
private bool recordProcessedSinceBatchStart = false;
|
||||||
private bool readAllInProgress = false;
|
|
||||||
|
|
||||||
public string Name => "Observatory Explorer";
|
public string Name => "Observatory Explorer";
|
||||||
|
|
||||||
@ -57,12 +56,12 @@ namespace Observatory.Explorer
|
|||||||
|
|
||||||
public void JournalEvent<TJournal>(TJournal journal) where TJournal : JournalBase
|
public void JournalEvent<TJournal>(TJournal journal) where TJournal : JournalBase
|
||||||
{
|
{
|
||||||
bool recordProcessed = false;
|
|
||||||
switch (journal)
|
switch (journal)
|
||||||
{
|
{
|
||||||
case Scan scan:
|
case Scan scan:
|
||||||
explorer.ProcessScan(scan, readAllInProgress);
|
explorer.ProcessScan(scan, Core.IsLogMonitorBatchReading && recordProcessedSinceBatchStart);
|
||||||
recordProcessed = true;
|
// Set this *after* the first scan processes so that we get the current custom criteria file.
|
||||||
|
if (Core.IsLogMonitorBatchReading) recordProcessedSinceBatchStart = true;
|
||||||
break;
|
break;
|
||||||
case FSSBodySignals signals:
|
case FSSBodySignals signals:
|
||||||
explorer.RecordSignal(signals);
|
explorer.RecordSignal(signals);
|
||||||
@ -84,24 +83,20 @@ namespace Observatory.Explorer
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set this *after* the first scan processes so that we get the current custom criteria file.
|
|
||||||
if (readAllStarting && recordProcessed)
|
|
||||||
readAllInProgress = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReadAllStarted()
|
public void LogMonitorStateChanged(LogMonitorStateChangedEventArgs args)
|
||||||
{
|
{
|
||||||
readAllStarting = true;
|
if (LogMonitorStateChangedEventArgs.IsBatchRead(args.NewState))
|
||||||
|
{
|
||||||
|
// Beginning a batch read. Clear grid.
|
||||||
|
recordProcessedSinceBatchStart = false;
|
||||||
Core.ClearGrid(this, new ExplorerUIResults());
|
Core.ClearGrid(this, new ExplorerUIResults());
|
||||||
explorer.Clear();
|
explorer.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReadAllFinished()
|
|
||||||
{
|
|
||||||
readAllStarting = false;
|
|
||||||
readAllInProgress = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public object Settings
|
public object Settings
|
||||||
{
|
{
|
||||||
get => settings;
|
get => settings;
|
||||||
|
@ -69,4 +69,40 @@ namespace Observatory.Framework
|
|||||||
PluginNotifier = 4,
|
PluginNotifier = 4,
|
||||||
All = (NativeVisual | NativeVocal | PluginNotifier)
|
All = (NativeVisual | NativeVocal | PluginNotifier)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Flags]
|
||||||
|
public enum LogMonitorState : uint
|
||||||
|
{
|
||||||
|
// These need to be multiples of 2 as they're used via masking.
|
||||||
|
Idle = 0, // Monitoring is stopped
|
||||||
|
Realtime = 1, // Real-time monitoring is active
|
||||||
|
Batch = 2, // Performing a batch read of history
|
||||||
|
PreRead = 4 // Currently pre-reading current system context (a batch read)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides information about a LogMonitor state transition.
|
||||||
|
/// </summary>
|
||||||
|
public class LogMonitorStateChangedEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The previous LogMonitor state.
|
||||||
|
/// </summary>
|
||||||
|
public LogMonitorState PreviousState;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The new, current LogMonitor state.
|
||||||
|
/// </summary>
|
||||||
|
public LogMonitorState NewState;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determins if the given state is a batch read of any form.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="state">The state to evaluate</param>
|
||||||
|
/// <returns>A boolean; True iff the state provided represents a batch-mode read.</returns>
|
||||||
|
public static bool IsBatchRead(LogMonitorState state)
|
||||||
|
{
|
||||||
|
return (state & (LogMonitorState.Batch | LogMonitorState.PreRead)) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,11 +76,19 @@ namespace Observatory.Framework.Interfaces
|
|||||||
public void StatusChange(Status status)
|
public void StatusChange(Status status)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the LogMonitor changes state. Useful for suppressing output in certain situations
|
||||||
|
/// such as batch reads (ie. "Read all") or responding to other state transitions.
|
||||||
|
/// </summary>
|
||||||
|
public void LogMonitorStateChanged(LogMonitorStateChangedEventArgs eventArgs)
|
||||||
|
{ }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Method called when the user begins "Read All" journal processing, before any journal events are sent.<br/>
|
/// Method called when the user begins "Read All" journal processing, before any journal events are sent.<br/>
|
||||||
/// Used to track if a "Read All" operation is in progress or not to avoid unnecessary processing or notifications.<br/>
|
/// Used to track if a "Read All" operation is in progress or not to avoid unnecessary processing or notifications.<br/>
|
||||||
/// Can be omitted for plugins which do not require the distinction.
|
/// Can be omitted for plugins which do not require the distinction.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete] // Replaced by LogMonitorStateChanged
|
||||||
public void ReadAllStarted()
|
public void ReadAllStarted()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@ -89,6 +97,7 @@ namespace Observatory.Framework.Interfaces
|
|||||||
/// Used to track if a "Read All" operation is in progress or not to avoid unnecessary processing or notifications.<br/>
|
/// Used to track if a "Read All" operation is in progress or not to avoid unnecessary processing or notifications.<br/>
|
||||||
/// Can be omitted for plugins which do not require the distinction.
|
/// Can be omitted for plugins which do not require the distinction.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete] // Replaced by LogMonitorStateChanged
|
||||||
public void ReadAllFinished()
|
public void ReadAllFinished()
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
@ -175,5 +184,15 @@ namespace Observatory.Framework.Interfaces
|
|||||||
/// Shared application HttpClient object. Provided so that plugins can adhere to .NET recommended behaviour of a single HttpClient object per application.
|
/// Shared application HttpClient object. Provided so that plugins can adhere to .NET recommended behaviour of a single HttpClient object per application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HttpClient HttpClient { get; }
|
public HttpClient HttpClient { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the current LogMonitor state.
|
||||||
|
/// </summary>
|
||||||
|
public LogMonitorState CurrentLogMonitorState { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true if the current LogMonitor state represents a batch-read mode.
|
||||||
|
/// </summary>
|
||||||
|
public bool IsLogMonitorBatchReading { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user