Simplify ProcessLogLine method

This commit is contained in:
Matt Nadareski
2024-12-18 23:21:58 -05:00
parent 0cdf2fc520
commit 76029d02ea
2 changed files with 4 additions and 20 deletions

View File

@@ -85,6 +85,7 @@
- Remove non-working last line log code
- Fix access level for log queue
- Fix access level for log document
- Simplify ProcessLogLine method
### 3.2.4 (2024-11-24)

View File

@@ -121,31 +121,14 @@ namespace MPF.UI.UserControls
/// <summary>
/// Process the log lines in the queue
/// </summary>
/// <param name="nextLogLine">LogLine item to process</param>
internal void ProcessLogLine(LogLine nextLogLine)
/// <param name="logLine">LogLine item to process</param>
internal void ProcessLogLine(LogLine logLine)
{
// Null text gets ignored
string nextText = nextLogLine.Text;
string nextText = logLine.Text;
if (nextText == null)
return;
try
{
AppendToTextBox(nextLogLine);
}
catch (Exception ex)
{
// In the event that something fails horribly, we want to log
AppendToTextBox(new LogLine(ex.ToString(), LogLevel.ERROR));
}
}
/// <summary>
/// Append log line to the log text box
/// </summary>
/// <param name="logLine">LogLine value to append</param>
private void AppendToTextBox(LogLine logLine)
{
Dispatcher.Invoke(() =>
{
var run = logLine.GenerateRun();