aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs11
1 files changed, 9 insertions, 2 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>