Add option for log formatting

This commit is contained in:
Matt Nadareski
2021-04-09 12:03:30 -07:00
parent a413357b57
commit 0c68164d6d
4 changed files with 24 additions and 1 deletions

View File

@@ -333,6 +333,12 @@ namespace MPF.Data
set { _settings["OpenLogWindowAtStartup"] = value.ToString(); }
}
public bool EnableLogFormatting
{
get { return GetBooleanSetting(_settings, "EnableFancyLog", true); }
set { _settings["EnableFancyLog"] = value.ToString(); }
}
public bool EnableProgressProcessing
{
get { return GetBooleanSetting(_settings, "EnableProgressProcessing", true); }

View File

@@ -378,6 +378,13 @@ namespace MPF.UserControls
try
{
// If we're not processing log formatting, just append and continue
if (!ViewModels.OptionsViewModel.EnableLogFormatting)
{
AppendToTextBox(nextLogLine);
return;
}
// Get last line
lastLine = lastLine ?? GetLastLine();

View File

@@ -12,6 +12,11 @@
get { return _uiOptions.Options.VerboseLogging; }
}
public bool EnableLogFormatting
{
get { return _uiOptions.Options.EnableLogFormatting; }
}
public bool EnableProgressProcessing
{
get { return _uiOptions.Options.EnableProgressProcessing; }

View File

@@ -228,8 +228,13 @@
ToolTip="Open the log panel when the program launches" Margin="0,4"
/>
<CheckBox VerticalAlignment="Center" Content="Enable Log Formatting"
IsChecked="{Binding Path=UIOptions.Options.EnableLogFormatting}"
ToolTip="Format log lines written to the log, including overwriting previous lines on match. Disable this if you have a weaker system as there is an increased processing load otherwise." Margin="0,4"
/>
<CheckBox VerticalAlignment="Center" Content="Enable Progress Processing"
IsChecked="{Binding Path=UIOptions.Options.EnableProgressProcessing}"
IsChecked="{Binding Path=UIOptions.Options.EnableProgressProcessing}" IsEnabled="{Binding Path=UIOptions.Options.EnableLogFormatting}"
ToolTip="Process lines written to the log to update the progress bar. Disable this if you have a weaker system as there is an increased processing load otherwise." Margin="0,4"
/>
</UniformGrid>