Soenneker.Tests.Logging 4.0.155

Prefix Reserved
dotnet add package Soenneker.Tests.Logging --version 4.0.155
                    
NuGet\Install-Package Soenneker.Tests.Logging -Version 4.0.155
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Tests.Logging" Version="4.0.155" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Tests.Logging" Version="4.0.155" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Tests.Logging" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Tests.Logging --version 4.0.155
                    
#r "nuget: Soenneker.Tests.Logging, 4.0.155"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Tests.Logging@4.0.155
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Tests.Logging&version=4.0.155
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Tests.Logging&version=4.0.155
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Tests.Logging

An infrastructure base class for test frameworks that want a lazily supplied ILogger and logged asynchronous delays.

Installation

dotnet add package Soenneker.Tests.Logging

Most applications should consume this indirectly through Soenneker.Tests.Unit, Soenneker.Tests.HostedUnit, or Soenneker.Tests.Integration, which configure the logger for their respective lifecycles.

Custom derivation

When deriving directly, initialize LazyLogger before Logger or a logged Delay is used:

using Microsoft.Extensions.Logging;
using Soenneker.Tests.Logging;

public abstract class LoggedTestBase : LoggingTest
{
    protected LoggedTestBase(ILoggerFactory loggerFactory)
    {
        LazyLogger = new Lazy<ILogger<LoggingTest>>(
            () => loggerFactory.CreateLogger<LoggingTest>());
    }
}

The package does not create or own the logger factory. The derived test infrastructure controls logger lifetime and where output is written.

Logged delays

await Delay(
    millisecondsDelay: 250,
    reason: "waiting for the worker to observe the message",
    cancellationToken: cancellationToken);

Delay logs at debug level immediately before calling Task.Delay. Set log: false to suppress that message. Cancellation and invalid delay values follow normal Task.Delay behavior.

Prefer waiting on an observable condition when one is available. A logged delay makes an unavoidable timing wait easier to diagnose, but it does not make time-dependent tests deterministic.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Soenneker.Tests.Logging:

Package Downloads
Soenneker.Tests.Unit

A base test providing faker and autofaker capabilities

Soenneker.Tests.Integration

A TUnit base class for integration tests that use a shared WebApplicationFactory host.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.155 21 8/30/2026
4.0.154 1,274 8/29/2026
4.0.153 41 8/29/2026
4.0.151 52,582 8/20/2026
4.0.150 30,392 8/11/2026
4.0.149 76,616 7/28/2026
4.0.148 42,542 7/19/2026
4.0.147 32,692 7/16/2026
4.0.146 22,162 7/14/2026
4.0.145 71,695 6/18/2026
4.0.144 63,396 6/9/2026
4.0.143 34,029 6/5/2026
4.0.142 75,206 5/12/2026
4.0.141 70,315 4/22/2026
4.0.140 128 4/22/2026
4.0.139 18,071 4/20/2026
4.0.138 20,535 4/14/2026
4.0.137 55,478 3/12/2026
4.0.132 29,834 3/10/2026
4.0.131 143 3/10/2026
Loading failed

Document test logging base configuration