Odin.Logging 0.9.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Odin.Logging --version 0.9.4
                    
NuGet\Install-Package Odin.Logging -Version 0.9.4
                    
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="Odin.Logging" Version="0.9.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Odin.Logging" Version="0.9.4" />
                    
Directory.Packages.props
<PackageReference Include="Odin.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 Odin.Logging --version 0.9.4
                    
#r "nuget: Odin.Logging, 0.9.4"
                    
#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 Odin.Logging@0.9.4
                    
#: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=Odin.Logging&version=0.9.4
                    
Install as a Cake Addin
#tool nuget:?package=Odin.Logging&version=0.9.4
                    
Install as a Cake Tool

About Odin.Logging

NuGet Nuget

Odin.Logging, part of the OrDinary INfrastructure libraries, provides an ILoggerWrapper of T that extends .NET's ILogger of T with all the LogXXX(...) calls as provided by the .NET LoggerExtensions extension methods (and a few more), for simpler logging assertion verifications.

On Robustness...

Correctness, the prime quality of great software, is complemented by robustness. Robustness is a reflection of how well (or badly) software behaves outside of it's intended specification \ use cases.

Highly robust software very accurately communicates arising issues outside of the specification through telemetry (logging).

A best practice to achieve and continuously maintain a high level of robustness in large applications it to assert all logging and telemetry scenarios in automated tests, which is the reason for the creation of ILoggerWrapper, namely far less onerous verification of logging calls.

Getting Started

1 - Add package

Add the Odin.Logging package from NuGet to your project using the command...

   dotnet add package Odin.Logging

2 - Add ILoggerWrapper<T> to DI in your startup code

    var builder = WebApplication.CreateBuilder(args);
    ...
    builder.Services.AddOdinLoggerWrapper();

3 - Configure .NET Logging and ILogger

As you normally would in startup code and configuration. Eg...

{
  "Logging": {
    "LogLevel": {
      "Default": "Warning",
      "MyApp": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting": "Information",
      "System": "Warning"
    }
  }
}

4 - Log using ILoggerWrapper<T> instead of ILogger<T>

    
    public class HitchHikerService(ILoggerWrapper<HitchHikerService> logger) : IHitchHikerService
    {
        public async Task VisitRestaurantAtEndOfUniverse()
        {
            ...
            _logger.LogError("Ford Prefect is missing!");
            ...
        }
    }

5 - Assert logging calls more simply in tests

    _loggerWrapperMock.Verify(x => x.LogError(It.Is<string>(c => 
        c.Contains("Ford Prefect"))), Times.Once);
    
    // as opposed to this with ILogger
    _iLoggerMock.Verify(
        x => x.Log(
            LogLevel.Error,
            It.IsAny<EventId>(),
            It.Is<It.IsAnyType>((state, _) =>
                state.ToString() == "Ford Prefect is missing!"),
            It.IsAny<Exception?>(),
            It.IsAny<Func<It.IsAnyType, Exception?, string>>()),
        Times.Once);
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 is compatible.  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 (6)

Showing the top 5 NuGet packages that depend on Odin.Logging:

Package Downloads
Odin.Common

Common elements used in the OrdinaryInfrastructure libraries, including logging, design contract elements, and various other elements. Odin = OrDinary INfrastructure.

Odin.Cryptography

Originally intended as a wrapper for ordinary use cases around .NET DataProtection APIs. Provides a simple ICryptographer concept supporting Encrypt and Decrypt.

Odin.BackgroundProcessing.Hangfire

Concrete implementation of IBackgroundProcessor via Hangfire.

Odin.Email.Mailgun

Mailgun support for IEmailSender.

Odin.Email.Office365

Office365 support for IEmailSender via Microsoft Graph (not SMTP).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.43 181 2/13/2026
0.9.42 142 2/6/2026
0.9.37 822 1/6/2026
0.9.37-traderbilling-up0011 160 1/6/2026
0.9.37-traderbilling-up0004 157 1/5/2026
0.9.36-designcontractsv0019 240 12/22/2025
0.9.32 240 12/21/2025
0.9.25 222 12/21/2025
0.9.21 222 12/21/2025
0.9.11 791 12/19/2025
0.9.10 302 12/19/2025
0.9.9 364 12/18/2025
0.9.8 341 12/15/2025
0.9.7 329 12/15/2025
0.9.6 328 12/15/2025
0.9.5 324 12/15/2025
0.9.4 318 12/15/2025
0.9.3 499 12/11/2025
0.9.2 506 12/11/2025
0.9.1 525 12/9/2025
Loading failed