Eigenverft.NetLib.Logging.Deferred 1.0.0.5

dotnet add package Eigenverft.NetLib.Logging.Deferred --version 1.0.0.5
                    
NuGet\Install-Package Eigenverft.NetLib.Logging.Deferred -Version 1.0.0.5
                    
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="Eigenverft.NetLib.Logging.Deferred" Version="1.0.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Eigenverft.NetLib.Logging.Deferred" Version="1.0.0.5" />
                    
Directory.Packages.props
<PackageReference Include="Eigenverft.NetLib.Logging.Deferred" />
                    
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 Eigenverft.NetLib.Logging.Deferred --version 1.0.0.5
                    
#r "nuget: Eigenverft.NetLib.Logging.Deferred, 1.0.0.5"
                    
#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 Eigenverft.NetLib.Logging.Deferred@1.0.0.5
                    
#: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=Eigenverft.NetLib.Logging.Deferred&version=1.0.0.5
                    
Install as a Cake Addin
#tool nuget:?package=Eigenverft.NetLib.Logging.Deferred&version=1.0.0.5
                    
Install as a Cake Tool

Eigenverft.NetLib.Logging.Deferred

NuGet Version NuGet Downloads Repository CI Targets License

Defer message and structured-argument work until the underlying Microsoft logger enables the requested level. Use standard ILogger categories and providers with lazy factories for expensive diagnostics.

✨ At a glance

Package Eigenverft.NetLib.Logging.Deferred
APIs IDeferredLogger<TCategoryName>, AddDeferredLogging(), ToDeferred()
Integration Microsoft.Extensions.Logging and dependency injection
Target frameworks .NET 8 and .NET 10
License MIT

📦 Installation

dotnet add package Eigenverft.NetLib.Logging.Deferred

🚀 Quick start

Register the adapters with the Generic Host. A factory argument is evaluated only when the underlying logger enables that level:

using System.IO;
using Eigenverft.NetLib.Logging.Deferred;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
builder.Services.AddDeferredLogging();

using IHost host = builder.Build();
IDeferredLogger<Program> logger =
    host.Services.GetRequiredService<IDeferredLogger<Program>>();

string settingsDirectory = Path.Combine(
    builder.Environment.ContentRootPath,
    "settings");
logger.LogDebug(
    "Discovered {FileCount} files",
    () => Directory.GetFiles(settingsDirectory).Length);
logger.LogInformation(
    () => $"Loaded settings from {settingsDirectory}.");

The same interfaces support standard levels and exception overloads. Structured message templates remain intact; only the supplied message or argument factories are evaluated lazily.

🧭 Registration and evaluation behavior

AddDeferredLogging() registers singleton generic and non-generic adapters over the normal ILogger<T>, ILogger, and ILoggerFactory services. It does not configure a logging provider. Generic Host applications already provide those services; with a plain service collection, register logging with services.AddLogging() first.

Factory overloads such as LogDebug("Count {Count}", () ⇒ ComputeCount()) avoid the computation when Debug is disabled. Eager values such as LogDebug("Count {Count}", ComputeCount()) are evaluated by the caller before the method is invoked. A disabled level skips factory evaluation; an enabled level evaluates each supplied factory once.

logger.ToDeferred() adapts an existing typed or untyped ILogger, including a bootstrap logger. The adapter uses that logger directly and preserves its category. This is lazy evaluation, not buffering: the wrapped logger is supplied when the adapter is created, and no messages are queued while waiting for a provider.

🎯 Target frameworks

The package targets net8.0 and net10.0.

📄 License

MIT License

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 (1)

Showing the top 1 NuGet packages that depend on Eigenverft.NetLib.Logging.Deferred:

Package Downloads
Eigenverft.Routed.RequestFilters

ASP.NET Core request filtering, filter-event storage, and evaluation middleware for configurable request policies.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0.5 89 9/29/2026
1.0.0.4 89 9/28/2026
1.0.0.3 127 9/12/2026

Initial capability package extracted from Eigenverft.NetLib.Infrastructure.