AnalogFeelings.Matcha 2.1.0

dotnet add package AnalogFeelings.Matcha --version 2.1.0                
NuGet\Install-Package AnalogFeelings.Matcha -Version 2.1.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="AnalogFeelings.Matcha" Version="2.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AnalogFeelings.Matcha --version 2.1.0                
#r "nuget: AnalogFeelings.Matcha, 2.1.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.
// Install AnalogFeelings.Matcha as a Cake Addin
#addin nuget:?package=AnalogFeelings.Matcha&version=2.1.0

// Install AnalogFeelings.Matcha as a Cake Tool
#tool nuget:?package=AnalogFeelings.Matcha&version=2.1.0                

🍵 Matcha

GitHub issues GitHub Issues or Pull Requests GitHub Repo stars GitHub GitHub commit activity Mastodon Follow

A simple but neat logging library for .NET 7.0 and higher. It includes XML documentation!

The library is built with extensibility in mind, by adding a "sink" system where each Log call is sent to all sinks for processing instead of centralizing everything into the main logger class.

It comes with 3 default logging sinks:

  • Console
  • Debugger
  • File

Important! All of the built-in sinks are thread-safe, but the library doesn't enforce this. Use third party sinks with caution!

🤔 Usage

Create the needed sinks and their configurations and pass them to the constructor to MatchaLogger.
Adding or removing sinks at runtime is not allowed, but this may change in a future release.

You may change a sink's configuration at runtime by keeping a reference to it.
Matcha will automatically dispose any sinks that implement IDisposable when Matcha itself is disposed.

🖌️ Custom Sinks

Creating a custom sink requires you to implement IMatchaSink<out T>, where T may be any class, record or struct that inherits from SinkConfig.

WriteLogAsync may be marked as async, and the sink can optionally also implement IDisposable if it has resources that need to be disposed.

Tip! Implement a SemaphoreSlim for thread safety, and release it inside a finally block. This will prevent deadlocks if an error occurs during logging.

Tip! Matcha exposes the method used to generate the newline indentation strings, just use the Common class and you'll find it!

📥 Downloads

You can find this package in NuGet.

Alternatively, you could download it from the releases page.

⚖️ License

Licensed under the MIT License. You can read it here.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 390 7/15/2024
2.0.1 266 4/12/2024
2.0.0 118 4/11/2024

Fix NotImplementedException being thrown when FileSink is disposed.
Move GenerateIndents internal function to a public Common class.