aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ServerApplication/Logging/LogWindow.xaml.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-05-02 11:12:35 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-05-02 11:12:35 -0400
commita190627c029070d7d109f024e96937c4e8e92d2d (patch)
tree1476591a8f19b9f20186d8583ff79919ebbe325d /MediaBrowser.ServerApplication/Logging/LogWindow.xaml.cs
parentd7be8bd1f59a5f6d0d55b5f6ce0ba6a8422baf7c (diff)
parentea14160b8712b42b92d6a6cd01f807ad989a0b76 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.ServerApplication/Logging/LogWindow.xaml.cs')
-rw-r--r--MediaBrowser.ServerApplication/Logging/LogWindow.xaml.cs11
1 files changed, 10 insertions, 1 deletions
diff --git a/MediaBrowser.ServerApplication/Logging/LogWindow.xaml.cs b/MediaBrowser.ServerApplication/Logging/LogWindow.xaml.cs
index 31739577f..f26fcb26c 100644
--- a/MediaBrowser.ServerApplication/Logging/LogWindow.xaml.cs
+++ b/MediaBrowser.ServerApplication/Logging/LogWindow.xaml.cs
@@ -69,7 +69,16 @@ namespace MediaBrowser.ServerApplication.Logging
/// <param name="msg">The MSG.</param>
public async void LogMessage(string msg)
{
- await Task.Factory.StartNew(() => lbxLogData.Items.Insert(0, msg.TrimEnd('\n')), CancellationToken.None, TaskCreationOptions.None, _uiThread);
+ await Task.Factory.StartNew(() =>
+ {
+ if (lbxLogData.Items.Count > 10000)
+ {
+ //I think the quickest and safest thing to do here is just clear it out
+ lbxLogData.Items.Clear();
+ }
+
+ lbxLogData.Items.Insert(0, msg.TrimEnd('\n'));
+ }, CancellationToken.None, TaskCreationOptions.None, _uiThread);
}
/// <summary>