diff options
| author | Eric Reed <ebr@mediabrowser3.com> | 2013-05-02 10:39:26 -0400 |
|---|---|---|
| committer | Eric Reed <ebr@mediabrowser3.com> | 2013-05-02 10:39:26 -0400 |
| commit | 6176225a7a5b22358be8ea88052e40d1d19e51d4 (patch) | |
| tree | ad1d6b29afc74a5c222956ae6b1958fc4a31d952 /MediaBrowser.ServerApplication/Logging/LogWindow.xaml.cs | |
| parent | e3f3c0ed0a3be4a557be92de7d100c5488a4cee0 (diff) | |
Cap log window at 10k rows
Diffstat (limited to 'MediaBrowser.ServerApplication/Logging/LogWindow.xaml.cs')
| -rw-r--r-- | MediaBrowser.ServerApplication/Logging/LogWindow.xaml.cs | 11 |
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> |
