Oakrey.Log.Abstractions 3.0.0

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

Oakrey.Log.Abstractions

1. Overview

The "Log.Abstractions" project provides shared contracts and infrastructure for Oakrey logging packages. It contains logger interfaces, log levels, log entry models, logger factory/proxy support, optional secret sanitizer contracts, and common logging utilities used by Oakrey.Log and related platform packages.

2. Features

Logging Contracts:

  • ILogger: Defines the common application logging API for Trace, Debug, Information, Warning, Error, and Critical messages.
  • ILogger<T>: Provides a typed logger contract for module-specific logging.
  • ILoggerEngine: Defines the low-level sink contract used by logger implementations.

Logging Levels:

  • Supports standard logging levels: Trace, Debug, Information, Warning, Error, and Critical (Level enum).
  • Provides short string, display name, and parsing helpers for log levels.

Logger Management:

  • LoggerFactory: Manages logger instances, global thresholds, module-specific filters, and optional secret sanitization.
  • LoggerProxy: Provides module-specific logger instances backed by the shared logger factory.

Secret Sanitization Contracts:

  • ILogSecretSanitizer: Allows plugging in a sanitizer that can redact log entries before they reach logger sinks.
  • EmptyLogSecretSanitizer: Default no-op sanitizer used to avoid overhead in applications that do not need secret redaction.
  • SecretSanitizationResult: Represents sanitizer output and redaction metadata.
  • Concrete sanitizers are provided by the optional Oakrey.Log.Sanitizers package.

Log Entry Representation:

  • LogEntry: Represents a single log entry with level, module, message, arguments, formatted message, and timestamp.

Utilities:

  • LoggerHelper: Provides safe message formatting and level helper methods.
  • LoggerExtensions: Provides convenience methods for entering, leaving, and safely executing logged actions.
  • ExceptionsHandling: Flattens nested exception messages for better readability.

Extensibility:

  • LoggerBase: Abstract base class for custom logger implementations.
  • Concrete loggers are provided by Oakrey.Log, Oakrey.Log.Windows, and related packages.

3. Installation

You can install the package via NuGet Package Manager, Package Manager Console or the .NET CLI.

NuGet Package Manager

  1. Open your project in Visual Studio.
  2. Navigate to Tools > NuGet Package Manager > Manage NuGet Packages for Solution....
  3. Search for Oakrey.Log.Abstractions and click Install.

.NET CLI

Run the following command in your terminal:

dotnet add package Oakrey.Log.Abstractions

Package Manager Console

Run the following command in your Package Manager Console:

Install-Package Oakrey.Log.Abstractions

4. Usage

Secret sanitization is disabled by default through EmptyLogSecretSanitizer, so logging stays lightweight unless an application explicitly configures a real sanitizer.

LoggerFactory.UseEmptySecretSanitizer();

Applications that need secret redaction can reference Oakrey.Log.Sanitizers and configure a concrete sanitizer:

LoggerFactory.SetSecretSanitizer(new DefaultSecretSanitizer());

When a configured sanitizer redacts a value, LoggerFactory emits a warning entry with metadata about the event. The warning does not include the original secret value.

5. Requirements

  • .NET 10 or higher

6. Project Information

7. Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve the package.

8. License

This project is licensed under the MIT License. See the LICENSE file for details.

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.
  • net10.0

    • No dependencies.

NuGet packages (11)

Showing the top 5 NuGet packages that depend on Oakrey.Log.Abstractions:

Package Downloads
Oakrey.Log

A flexible and extensible logging framework for .NET applications, supporting multiple logging mechanisms, custom loggers, and advanced log management features

Oakrey.Guru.Adapter

Base adapter library for Oakrey Guru USB hardware devices. Provides a structured packet-framing protocol with CRC16-CCITT validation, and transceiver, transmitter, and receiver abstractions over USB.

Oakrey.Guru.Lin

LIN bus adapter library for Oakrey Guru USB hardware. Provides up to 8 independent channels with master/slave role control, baud rate configuration (up to 19200), slave answer table management, bus voltage reading, and reactive Rx streams (ReceivedFrame, StatusChanged, ErrorEvent).

Oakrey.Guru.Handlers

Handler framework for Oakrey Guru USB hardware devices. Provides async request/reply command execution with configurable timeout, typed Rx event stream handlers, status-reply dispatch, and a thread-safe handler collection keyed by packet ID.

Oakrey.Guru.Base

Base device library for Oakrey Guru USB hardware devices. Provides DeviceBase, IDevice, and ILicense abstractions over the Guru packet protocol, including async firmware update from Intel HEX files, bootloader entry, multi-slot license key retrieval, and connection verification.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 166 7/10/2026