Odin.Logging 0.9.37

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

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

On Robustness and asserting logging behaviour...

Some musings on why I consider validation by unit testing of appropriate logging (of 1000s of out-of-scope to be handled application situations) to be an important contributor towards excellence with respect to Robustness.

Correctness, the prime quality of excellent software, reflects the ability of software to perform its intended exact behaviour. While 'exact behaviour' can range anywhere from a grey area of implicitly agreed-in-conversation-with-stakeholders rough functionality, to well-defined clearly written (and usually emerging) specifications (if you are lucky and have excellent product ownership).

Robustness, although a rather fuzzy notion, is a reflection of how appropriately software reacts and behaves outside of it's intended specification \ use cases, what the industry terms an 'abnormal case'. It is important to note that 'normal' in this sense means 'within specification', not 'desirable' or 'ideal' which are subjective notions. When an abnormal case emerges, where there is no specification or agreement on what the software must do, does the software communicate the matter timeously, fail gracefully if necessary, and not cause any damage? This is Robustness.

Timely communication of abnormal cases is generally handled at least through logging and telemetry.

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

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.37 152 1/6/2026
0.9.37-traderbilling-up0011 139 1/6/2026
0.9.37-traderbilling-up0004 145 1/5/2026
0.9.36-designcontractsv0019 230 12/22/2025
0.9.32 230 12/21/2025
0.9.25 213 12/21/2025
0.9.21 215 12/21/2025
0.9.11 312 12/19/2025
0.9.10 295 12/19/2025
0.9.9 349 12/18/2025
0.9.8 328 12/15/2025
0.9.7 323 12/15/2025
0.9.6 314 12/15/2025
0.9.5 315 12/15/2025
0.9.4 313 12/15/2025
0.9.3 491 12/11/2025
0.9.2 488 12/11/2025
0.9.1 515 12/9/2025
0.9.0 441 12/8/2025
0.4.16 337 12/7/2025
0.4.14 257 12/6/2025
0.4.13 380 12/6/2025
0.4.12 263 12/6/2025
0.4.11 310 12/5/2025
0.4.7 327 12/5/2025
0.4.6 358 12/5/2025
0.4.2 335 12/4/2025
0.4.0 339 12/4/2025
0.2.14 866 12/2/2025
0.2.10 578 11/30/2025
0.2.5 501 11/30/2025
0.2.4 464 11/30/2025
0.2.3 463 11/30/2025
0.2.2 347 11/22/2025
0.2.2-pullrequest0078-0006 313 11/6/2025
0.2.1 303 9/11/2025
0.2.0 289 8/21/2025
0.1.133 289 8/20/2025
0.1.133-fixpublish-mark0003 288 8/20/2025
0.1.132-pullrequest0071-0002 352 8/20/2025
0.1.131 562 8/20/2025