From fa53cf658d60afbcfb0449eb525da5a847075aa9 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 25 Mar 2018 16:26:36 +0300 Subject: Working on logging module. --- .../EventLogging/DefaultEventLogger.cs | 11 +++++++++++ .../Tango.MachineStudio.Common/EventLogging/IEventLogger.cs | 5 +++++ 2 files changed, 16 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs index b4015b297..0f19d3b6d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs @@ -35,6 +35,15 @@ namespace Tango.MachineStudio.Common.EventLogging private String _hostName; private bool _isInitialized; + #region Events + + /// + /// Occurs when a new machine event has been logged. + /// + public event EventHandler NewLog; + + #endregion + #region Constructors /// @@ -174,6 +183,8 @@ namespace Tango.MachineStudio.Common.EventLogging LogManager.Log("Logging event " + machineEvent.EventType.Name + " - " + machineEvent.Description); _events.Enqueue(machineEvent); + + NewLog?.Invoke(this, machineEvent); } /// diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs index bafdca914..aeecb4ae6 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs @@ -14,6 +14,11 @@ namespace Tango.MachineStudio.Common.EventLogging /// public interface IEventLogger { + /// + /// Occurs when a new machine event has been logged. + /// + event EventHandler NewLog; + /// /// Logs the specified machine event. /// -- cgit v1.3.1