An open API service indexing awesome lists of open source software.

https://github.com/benjaminabt/throwawaylogger

A very simple ILogging mock mechanism.
https://github.com/benjaminabt/throwawaylogger

benchmark logging unittests

Last synced: about 1 month ago
JSON representation

A very simple ILogging mock mechanism.

Awesome Lists containing this project

README

        

# ThrowAwayLogger

`ThrowAwayLogger` is an implementation of [`ILogger`](https://docs.microsoft.com/dotnet/core/extensions/custom-logging-provider?WT.mc_id=DT-MVP-5001507) as well as [`ILogger`](https://docs.microsoft.com/dotnet/core/extensions/custom-logging-provider?WT.mc_id=DT-MVP-5001507) which does nothing. Really: nothing.

Very handy for benchmarks or simple testing.

## NuGet

[BenjaminAbt.Extensions.Logger.ThrowAwayLogger](https://www.nuget.org/packages/BenjaminAbt.Extensions.Logger.ThrowAwayLogger/)

## Sample

```csharp
// field
private ILogger _log = new ThrowAwayLogger();

// call
_log.Log(LogLevel.Information, _ex, "Test " + _message);
```

Nothing happens ¯\_(ツ)_/¯