![]() |
VOOZH | about |
dotnet add package Odin.Logging --version 0.9.140
NuGet\Install-Package Odin.Logging -Version 0.9.140
<PackageReference Include="Odin.Logging" Version="0.9.140" />
<PackageVersion Include="Odin.Logging" Version="0.9.140" />Directory.Packages.props
<PackageReference Include="Odin.Logging" />Project file
paket add Odin.Logging --version 0.9.140
#r "nuget: Odin.Logging, 0.9.140"
#:package Odin.Logging@0.9.140
#addin nuget:?package=Odin.Logging&version=0.9.140Install as a Cake Addin
#tool nuget:?package=Odin.Logging&version=0.9.140Install as a Cake Tool
Odin.Logging, part of the OrDinary INfrastructure libraries, provides an ILoggerWrapper of T that wraps .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.
dotnet add package Odin.Logging
var builder = WebApplication.CreateBuilder(args);
...
builder.Services.AddOdinLoggerWrapper();
NOTE: AddOdinLoggerWrapper() requires ILogger ensure this by calling AddLogging()
As you normally would in startup code and\or configuration. Eg...
{
"Logging": {
"LogLevel": {
"Default": "Warning",
"MyApp": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting": "Information",
"System": "Warning"
}
}
}
public class HitchHikerService(ILoggerWrapper<HitchHikerService> logger) : IHitchHikerService
{
public async Task VisitRestaurantAtEndOfUniverse()
{
...
_logger.LogError("Ford Prefect is missing!");
...
}
}
_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);
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, 1 of the 2 prime qualities of truly excellent software IMHO, 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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
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 V3 API support for IEmailSender. |
|
|
Odin.Email.Office365
Office365 support for IEmailSender via Microsoft Graph (not SMTP). |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.9.140 | 214 | 6/10/2026 |
| 0.9.139 | 187 | 6/9/2026 |
| 0.9.138 | 195 | 6/9/2026 |
| 0.9.137 | 181 | 6/9/2026 |
| 0.9.135 | 208 | 6/7/2026 |
| 0.9.121 | 186 | 6/5/2026 |
| 0.9.120 | 191 | 6/5/2026 |
| 0.9.107 | 191 | 6/3/2026 |
| 0.9.105 | 398 | 5/26/2026 |
| 0.9.103 | 197 | 5/26/2026 |
| 0.9.102 | 193 | 5/25/2026 |
| 0.9.101 | 219 | 5/25/2026 |
| 0.9.100 | 206 | 5/21/2026 |
| 0.9.92 | 264 | 5/20/2026 |
| 0.9.88 | 219 | 5/20/2026 |
| 0.9.86 | 202 | 5/20/2026 |
| 0.9.85 | 268 | 5/20/2026 |
| 0.9.77 | 212 | 5/15/2026 |
| 0.9.76 | 206 | 5/15/2026 |
| 0.9.75 | 205 | 5/14/2026 |