mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
24 lines
676 B
Plaintext
24 lines
676 B
Plaintext
@using NLog
|
|
@using NLog.Targets
|
|
@namespace Wabbajack.App.Blazor.Components
|
|
|
|
<div id="virtual-logger">
|
|
<Virtualize Items="@Logs" Context="logItem" OverscanCount="3">
|
|
<span @key="logItem">@logItem</span>
|
|
</Virtualize>
|
|
</div>
|
|
|
|
@code {
|
|
|
|
// TODO: [Low] More parameters to customise the logger. E.g. Reverse order.
|
|
// TODO: [High] Find a way to auto-scroll. (JS interop?)
|
|
|
|
private MemoryTarget? _memoryTarget;
|
|
private ICollection<string> Logs => _memoryTarget?.Logs ?? Array.Empty<string>();
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
_memoryTarget = LogManager.Configuration.FindTargetByName<MemoryTarget>("ui");
|
|
}
|
|
}
|