diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-07-18 08:03:17 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-07-18 08:03:17 +0300 |
| commit | 4b0ca04d68b04507cd0947444936509bda3cb8c8 (patch) | |
| tree | ae9c5d19aa05bf20b1682dbc1ac3441fa2721c67 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging | |
| parent | e96d9f083aa58b24d2e64cbbec47e638d0ce84a0 (diff) | |
| parent | 97150bf5a7f5844d9da47523e3136ce87c305ba0 (diff) | |
| download | Tango-4b0ca04d68b04507cd0947444936509bda3cb8c8.tar.gz Tango-4b0ca04d68b04507cd0947444936509bda3cb8c8.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging')
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. |
