dotnet add package Soenneker.Serilog.Sinks.TUnit
Default usage enables live in-progress updates with a built-in 250ms throttle:
using var logger = new LoggerConfiguration()
.WriteTo.Sink(new TUnitTestContextSink())
.CreateLogger();If you want to customize the live update behavior, pass options explicitly:
using var logger = new LoggerConfiguration()
.WriteTo.Sink(new TUnitTestContextSink(new TUnitTestContextSinkOptions
{
EnableImmediateUpdates = true,
ImmediateUpdateThrottle = TimeSpan.FromMilliseconds(250)
}))
.CreateLogger();