mirror of
https://github.com/SabreTools/MPF.git
synced 2026-02-04 05:35:52 +00:00
Simplify ProcessLogLine method
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user