From 2ebbed964bdc4aa1c2889d6c4c0521b3ba1562aa Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 22 Mar 2020 16:50:25 +0200 Subject: Dropped logging categories from settings on MS and PPC. Debug Logs Processing is done in real time from UI. --- .../Tango.MachineStudio.Common/MachineStudioSettings.cs | 6 ------ 1 file changed, 6 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs index 7a016b376..25dfc2dc8 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs @@ -56,11 +56,6 @@ namespace Tango.MachineStudio.Common /// public String LastVirtualMachineSerialNumber { get; set; } - /// - /// Gets or sets the logging categories. - /// - public List LoggingCategories { get; set; } - /// /// Gets or sets the last bounds. /// @@ -189,7 +184,6 @@ namespace Tango.MachineStudio.Common public MachineStudioSettings() { LastBounds = new Rect(); - LoggingCategories = new List(); DefaultIssueReportTags = new List(); StudioModulesBounds = new List(); Environment = WorkingEnvironment.Remote; -- cgit v1.3.1 From 112704ab16ceb60490432bcccd897c27fd041092 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 22 Mar 2020 17:12:26 +0200 Subject: Prevent machine studio from saving events to db when connected via external bridge. --- .../EventLogging/DefaultEventLogger.cs | 20 +++++++++++++++++++- .../EventLogging/IEventLogger.cs | 5 +++++ 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common') 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 b92c9f285..f1a205f5d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs @@ -47,6 +47,15 @@ namespace Tango.MachineStudio.Common.EventLogging #endregion + #region Properties + + /// + /// Gets or sets a value indicating whether to save the incoming events to database. + /// + public bool SaveToDB { get; set; } + + #endregion + #region Constructors /// @@ -58,6 +67,8 @@ namespace Tango.MachineStudio.Common.EventLogging { _hostName = Environment.MachineName; + SaveToDB = true; + _events = new ConcurrentQueue(); _pendingEvents = new List(); @@ -128,6 +139,8 @@ namespace Tango.MachineStudio.Common.EventLogging machine.RequestSent += Machine_RequestSent; machine.RequestFailed += Machine_RequestFailed; machine.ResponseReceived += Machine_ResponseReceived; + + SaveToDB = !(machine is IExternalBridgeSecureClient); } } @@ -244,7 +257,7 @@ namespace Tango.MachineStudio.Common.EventLogging machineEvent.EventType = _eventTypesGuids[eventType]; machineEvent.EventTypeGuid = machineEvent.EventType.Guid; - if (write_to_db) + if (write_to_db && SaveToDB) { Log(machineEvent); } @@ -308,6 +321,11 @@ namespace Tango.MachineStudio.Common.EventLogging /// public void FlushAll() { + if (!SaveToDB) + { + return; + } + bool _saveChanges = false; while (_events.Count > 0) 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 ceb399d24..44916ec21 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs @@ -19,6 +19,11 @@ namespace Tango.MachineStudio.Common.EventLogging /// event EventHandler NewLog; + /// + /// Gets or sets a value indicating whether to save the incoming events to database. + /// + bool SaveToDB { get; set; } + /// /// Logs the specified machine event. /// -- cgit v1.3.1