aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-19 14:48:11 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-19 14:48:11 +0300
commitc4feba445987d33c7bfcc304a3be368e8458d408 (patch)
tree0be608bb86ddd4a8369501f49b74de8178bacc65 /Software/Visual_Studio
parent24a77fd5e03c81c6b0e901da02bce4bdccd4c71c (diff)
downloadTango-c4feba445987d33c7bfcc304a3be368e8458d408.tar.gz
Tango-c4feba445987d33c7bfcc304a3be368e8458d408.zip
Some log improvements in TransporterBase.
Added dynamic display/hide debug logs on logging module.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs29
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml10
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt2
-rw-r--r--Software/Visual_Studio/Tango.Transport/TransporterBase.cs4
4 files changed, 25 insertions, 20 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs
index c56ca5541..b0bc613bd 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs
@@ -57,6 +57,16 @@ namespace Tango.MachineStudio.Logging.ViewModels
}
}
+ private bool _displayDebug;
+ /// <summary>
+ /// Gets or sets a value indicating whether display debug logs.
+ /// </summary>
+ public bool DisplayDebug
+ {
+ get { return _displayDebug; }
+ set { _displayDebug = value; RaisePropertyChangedAuto(); }
+ }
+
private LogItemBase _selectedLog;
public LogItemBase SelectedLog
{
@@ -169,21 +179,12 @@ namespace Tango.MachineStudio.Logging.ViewModels
private void LogManager_NewLog(object sender, LogItemBase log)
{
+ if (log.Category == LogCategory.Debug && !DisplayDebug) return;
+
if (!RealTimePaused)
{
InvokeUI(() =>
{
- if (_is_debug)
- {
- if (_realTimeLogs.Count > 1000)
- {
- for (int i = 998; i < _realTimeLogs.Count; i++)
- {
- _realTimeLogs.RemoveAt(i);
- }
- }
- }
-
_realTimeLogs.Insert(0, log);
});
}
@@ -225,10 +226,10 @@ namespace Tango.MachineStudio.Logging.ViewModels
if (SelectedLog != null && !_dialog_shown)
{
_dialog_shown = true;
- _notification.ShowModalDialog<LogDetailsViewVM, ApplicationLogDetailsView>(new LogDetailsViewVM(SelectedLog), (x) =>
+ _notification.ShowModalDialog<LogDetailsViewVM, ApplicationLogDetailsView>(new LogDetailsViewVM(SelectedLog), (x) =>
{
-
- }, () =>
+
+ }, () =>
{
_dialog_shown = false;
});
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml
index 310f4fd87..eeb7204d1 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml
@@ -100,10 +100,12 @@
</StackPanel>
</Button>
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="30 0 0 0">
- <materialDesign:PackIcon Kind="Magnify" Width="24" Height="24" />
- <TextBox VerticalAlignment="Center" Margin="10 0 0 0" Width="200" Text="{Binding Filter,UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding RealTimePaused}" materialDesign:HintAssist.Hint="Filter" />
- </StackPanel>
+ <CheckBox VerticalAlignment="Center" Margin="20 0 0 0" IsChecked="{Binding DisplayDebug}" ToolTip="Hide/Display debug logs (applies only when debug logs are enabled in the settings file)">Process Debug Logs</CheckBox>
+ </StackPanel>
+
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 30 0">
+ <materialDesign:PackIcon Kind="Magnify" Width="24" Height="24" />
+ <TextBox VerticalAlignment="Center" Margin="10 0 0 0" Width="300" Text="{Binding Filter,UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding RealTimePaused}" materialDesign:HintAssist.Hint="Filter" />
</StackPanel>
</Grid>
</Border>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt
index 3c8a1e91c..625616f0e 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt
@@ -1 +1 @@
-Thu 07/19/2018 14:26:11.83
+Thu 07/19/2018 14:46:09.13
diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs
index dbeae5b41..6b566ab58 100644
--- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs
+++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs
@@ -641,6 +641,8 @@ namespace Tango.Transport
LogManager.Log("Parsing message container...", LogCategory.Debug);
MessageContainer container = Encoder.DecodeContainer(data);
+ LogManager.Log("Message was identified as " + container.Type + ".", LogCategory.Debug);
+
if (container.Token.Length != MESSAGE_TOKEN_LENGTH)
{
LogManager.Log("Invalid message token length received: " + container.Token, LogCategory.Error);
@@ -683,7 +685,7 @@ namespace Tango.Transport
}
else
{
- LogManager.Log("Pending request was identified as 'continuous response' " + container.Type + ". keeping pending request.", LogCategory.Debug);
+ LogManager.Log("Pending request was identified as 'continuous response'. keeping pending request.", LogCategory.Debug);
try
{