aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-03-25 16:26:36 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-03-25 16:26:36 +0300
commitfa53cf658d60afbcfb0449eb525da5a847075aa9 (patch)
tree31c96d3bab8a54ebbf04be6aab14371be45aa1bb /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common
parent86197cd0ec87a6cc186e90f75d848adc6dfa2285 (diff)
downloadTango-fa53cf658d60afbcfb0449eb525da5a847075aa9.tar.gz
Tango-fa53cf658d60afbcfb0449eb525da5a847075aa9.zip
Working on logging module.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs11
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs5
2 files changed, 16 insertions, 0 deletions
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
+
+ /// <summary>
+ /// Occurs when a new machine event has been logged.
+ /// </summary>
+ public event EventHandler<MachinesEvent> NewLog;
+
+ #endregion
+
#region Constructors
/// <summary>
@@ -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);
}
/// <summary>
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
@@ -15,6 +15,11 @@ namespace Tango.MachineStudio.Common.EventLogging
public interface IEventLogger
{
/// <summary>
+ /// Occurs when a new machine event has been logged.
+ /// </summary>
+ event EventHandler<MachinesEvent> NewLog;
+
+ /// <summary>
/// Logs the specified machine event.
/// </summary>
/// <param name="machineEvent">The machine event.</param>