aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2018-07-18 17:52:17 +0300
committerAvi Levkovich <avi@twine-s.com>2018-07-18 17:52:17 +0300
commite0d570b8994b5d8ac3733075df9aa4d25e723131 (patch)
tree261ebcd32f07ec43cf29030036c077258d8c03a7 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging
parente0c19a620f338848b130ad6d2bd0ce8d5a52ca93 (diff)
parentdf566bfe8b0f5ab0978dc3fa600052cd300fc577 (diff)
downloadTango-e0d570b8994b5d8ac3733075df9aa4d25e723131.tar.gz
Tango-e0d570b8994b5d8ac3733075df9aa4d25e723131.zip
merge build date
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.