mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
18 lines
398 B
C#
18 lines
398 B
C#
|
using System;
|
|||
|
using System.Reactive.Subjects;
|
|||
|
using NLog;
|
|||
|
using NLog.Targets;
|
|||
|
|
|||
|
namespace Wabbajack.App.Blazor.Utility;
|
|||
|
|
|||
|
public class UiLoggerTarget : TargetWithLayout
|
|||
|
{
|
|||
|
private readonly Subject<string> _logs = new();
|
|||
|
public IObservable<string> Logs => _logs;
|
|||
|
|
|||
|
protected override void Write(LogEventInfo logEvent)
|
|||
|
{
|
|||
|
_logs.OnNext(RenderLogEvent(Layout, logEvent));
|
|||
|
}
|
|||
|
}
|