From c4feba445987d33c7bfcc304a3be368e8458d408 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 19 Jul 2018 14:48:11 +0300 Subject: Some log improvements in TransporterBase. Added dynamic display/hide debug logs on logging module. --- .../ViewModels/ApplicationLogsViewVM.cs | 29 +++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs') 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; + /// + /// Gets or sets a value indicating whether display debug logs. + /// + 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(new LogDetailsViewVM(SelectedLog), (x) => + _notification.ShowModalDialog(new LogDetailsViewVM(SelectedLog), (x) => { - - }, () => + + }, () => { _dialog_shown = false; }); -- cgit v1.3.1