aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2020-03-23 10:36:13 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2020-03-23 10:36:13 +0200
commit35842a2b231af79f34c7e8685bd1ca8313b1a122 (patch)
tree45680658dd7a03333a762c8a0b7b459e77a94b64 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common
parentc025ab482326b6809e40e4e35026b58488795df3 (diff)
parent3c4ff5beaa41a376ce42fa400d36d7a5a74330ec (diff)
downloadTango-35842a2b231af79f34c7e8685bd1ca8313b1a122.tar.gz
Tango-35842a2b231af79f34c7e8685bd1ca8313b1a122.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs20
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs5
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs6
3 files changed, 24 insertions, 7 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 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
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to save the incoming events to database.
+ /// </summary>
+ public bool SaveToDB { get; set; }
+
+ #endregion
+
#region Constructors
/// <summary>
@@ -58,6 +67,8 @@ namespace Tango.MachineStudio.Common.EventLogging
{
_hostName = Environment.MachineName;
+ SaveToDB = true;
+
_events = new ConcurrentQueue<MachinesEvent>();
_pendingEvents = new List<MachinesEvent>();
@@ -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
/// </summary>
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
@@ -20,6 +20,11 @@ namespace Tango.MachineStudio.Common.EventLogging
event EventHandler<MachinesEvent> NewLog;
/// <summary>
+ /// Gets or sets a value indicating whether to save the incoming events to database.
+ /// </summary>
+ bool SaveToDB { get; set; }
+
+ /// <summary>
/// Logs the specified machine event.
/// </summary>
/// <param name="machineEvent">The machine event.</param>
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
@@ -57,11 +57,6 @@ namespace Tango.MachineStudio.Common
public String LastVirtualMachineSerialNumber { get; set; }
/// <summary>
- /// Gets or sets the logging categories.
- /// </summary>
- public List<LogCategory> LoggingCategories { get; set; }
-
- /// <summary>
/// Gets or sets the last bounds.
/// </summary>
public Rect LastBounds { get; set; }
@@ -189,7 +184,6 @@ namespace Tango.MachineStudio.Common
public MachineStudioSettings()
{
LastBounds = new Rect();
- LoggingCategories = new List<LogCategory>();
DefaultIssueReportTags = new List<string>();
StudioModulesBounds = new List<StudioModuleBounds>();
Environment = WorkingEnvironment.Remote;