mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
Cap log window at 10k rows
This commit is contained in:
parent
e3f3c0ed0a
commit
6176225a7a
@ -69,7 +69,16 @@ namespace MediaBrowser.ServerApplication.Logging
|
|||||||
/// <param name="msg">The MSG.</param>
|
/// <param name="msg">The MSG.</param>
|
||||||
public async void LogMessage(string msg)
|
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>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user