mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 10:26:11 +08:00
Fix log issue in UWP test app.
This commit is contained in:
@@ -148,7 +148,7 @@
|
|||||||
</PivotItem>
|
</PivotItem>
|
||||||
<PivotItem Header="Log">
|
<PivotItem Header="Log">
|
||||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||||
<Button Click="Clear" Width="120">Clear</Button>
|
<Button Click="ClearLog" Width="120">Clear</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</PivotItem>
|
</PivotItem>
|
||||||
</Pivot>
|
</Pivot>
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ namespace MQTTnet.TestApp.UniversalWindows
|
|||||||
foreach (var traceMessage in _traceMessages)
|
foreach (var traceMessage in _traceMessages)
|
||||||
{
|
{
|
||||||
logText.AppendFormat(
|
logText.AppendFormat(
|
||||||
"[{0:yyyy-MM-dd HH:mm:ss.fff}] [{1}] [{2}] [{3}] [{4}]{5}", traceMessage.Timestamp,
|
"[{0:yyyy-MM-dd HH:mm:ss.fff}] [{1}] [{2}] [{3}] [{4}]{5}",
|
||||||
|
traceMessage.Timestamp,
|
||||||
traceMessage.Level,
|
traceMessage.Level,
|
||||||
traceMessage.Source,
|
traceMessage.Source,
|
||||||
traceMessage.ThreadId,
|
traceMessage.ThreadId,
|
||||||
@@ -197,8 +198,13 @@ namespace MQTTnet.TestApp.UniversalWindows
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Clear(object sender, RoutedEventArgs e)
|
private void ClearLog(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
while (_traceMessages.Count > 0)
|
||||||
|
{
|
||||||
|
_traceMessages.TryDequeue(out _);
|
||||||
|
}
|
||||||
|
|
||||||
Trace.Text = string.Empty;
|
Trace.Text = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user