aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging')
-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.cs2
2 files changed, 10 insertions, 3 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 0a4af6218..b33b771ae 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs
@@ -234,7 +234,7 @@ namespace Tango.MachineStudio.Common.EventLogging
/// </summary>
/// <param name="eventType">Type of the event.</param>
/// <param name="message">The message.</param>
- public void Log(EventTypes eventType, string message)
+ public void Log(EventTypes eventType, string message, bool write_to_db = true)
{
Init();
@@ -244,7 +244,14 @@ namespace Tango.MachineStudio.Common.EventLogging
machineEvent.EventType = _eventTypesGuids[eventType];
machineEvent.EventTypeGuid = machineEvent.EventType.Guid;
- Log(machineEvent);
+ if (write_to_db)
+ {
+ Log(machineEvent);
+ }
+ else
+ {
+ 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 ce599a398..ceb399d24 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs
@@ -30,7 +30,7 @@ namespace Tango.MachineStudio.Common.EventLogging
/// </summary>
/// <param name="eventType">Type of the event.</param>
/// <param name="message">The message.</param>
- void Log(EventTypes eventType, String message);
+ void Log(EventTypes eventType, String message, bool write_to_db = true);
/// <summary>
/// Logs the specified hardware event.