mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 09:13:02 +08:00
Fix log issue in UWP test app.
This commit is contained in:
@@ -148,7 +148,7 @@
|
||||
</PivotItem>
|
||||
<PivotItem Header="Log">
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Button Click="Clear" Width="120">Clear</Button>
|
||||
<Button Click="ClearLog" Width="120">Clear</Button>
|
||||
</StackPanel>
|
||||
</PivotItem>
|
||||
</Pivot>
|
||||
|
||||
@@ -42,7 +42,8 @@ namespace MQTTnet.TestApp.UniversalWindows
|
||||
foreach (var traceMessage in _traceMessages)
|
||||
{
|
||||
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.Source,
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user