Skip to content

soenneker/soenneker.serilog.sinks.tunit

Soenneker.Serilog.Sinks.TUnit

A Serilog sink for logging within TUnit

Installation

dotnet add package Soenneker.Serilog.Sinks.TUnit

Usage

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();

About

A Serilog sink for logging within TUnit

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages