Psimsa.TinyLogger 1.0.43

There is a newer version of this package available.
See the version list below for details.
dotnet add package Psimsa.TinyLogger --version 1.0.43
                    
NuGet\Install-Package Psimsa.TinyLogger -Version 1.0.43
                    
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="Psimsa.TinyLogger" Version="1.0.43" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Psimsa.TinyLogger" Version="1.0.43" />
                    
Directory.Packages.props
<PackageReference Include="Psimsa.TinyLogger" />
                    
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 Psimsa.TinyLogger --version 1.0.43
                    
#r "nuget: Psimsa.TinyLogger, 1.0.43"
                    
#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 Psimsa.TinyLogger@1.0.43
                    
#: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=Psimsa.TinyLogger&version=1.0.43
                    
Install as a Cake Addin
#tool nuget:?package=Psimsa.TinyLogger&version=1.0.43
                    
Install as a Cake Tool

tiny-logger

A small, performant library for basic console logging in .Net projects. Implements the ILogger interface from Microsoft.Extensions.Logging, but with a smaller footprint and list of dependencies.

The library provides basic feature set for logging to the console while being usable in components and dependencies that use ILogger for output, well usable for instance in AOT-published tools.

Features

  • Does not use Microsoft.Extensions.DependencyInjection at all (unlike LoggerFactory.Create which uses it under the hood)
  • Fully supports AOT / code trimming
  • Outputs structured logs in JSON format
  • Minimal footprint in terms of memory usage, allocations etc.
  • Supports log levels, log templates and code-generated log methods
  • Can be used in any .Net project, including .Net Standard libraries (from 2.0)
  • Can be used in code-generated DI containers (e.g. Pure.DI)
  • Performs well in container or cloud scenarios where console output is captured by the runtime and further analyzed in e.g. CloudWatch or Application Insights
  • Performance comparable with Microsoft.Extensions.Logging (see benchmarks project in test folder / snapshot below)

Usage

ILogger logger = new TinyLogger<Program>();
logger.LogInformation("Hello world!");

Benchmarks


BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1555/22H2/2022Update/SunValley2)
11th Gen Intel Core i7-11850H 2.50GHz, 1 CPU, 16 logical and 8 physical cores
.NET SDK=7.0.203
  [Host]     : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2
  Job-MFQIFX : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2

Runtime=.NET 7.0  IterationCount=1  

Method Mean Error Allocated
Log_SingleThread_TinyLogger 119.5 μs NA 1.28 KB
Log_SingleThread_ConsoleLogger 114.2 μs NA 1.22 KB
Log_MultiThread_TinyLogger 112,887.2 μs NA 370.11 KB
Log_MultiThread_ConsoleLogger 116,492.2 μs NA 666.77 KB
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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.  net9.0 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.47 156 8/11/2025
1.0.46 164 7/8/2025
1.0.45 161 6/16/2025
1.0.44 306 6/9/2025
1.0.43 156 6/3/2025
1.0.42 169 5/22/2025
1.0.41 165 5/20/2025
1.0.40 131 2/11/2025
1.0.39 135 2/10/2025
1.0.38 129 1/20/2025
1.0.37 92 1/8/2025
1.0.36 128 12/31/2024
1.0.35 138 11/19/2024
1.0.34 135 11/6/2024
1.0.33 134 11/5/2024
1.0.32 135 10/13/2024
1.0.31 146 10/8/2024
1.0.30 138 10/8/2024
1.0.29 135 10/5/2024
1.0.28 141 9/27/2024
1.0.27 141 9/23/2024
1.0.26 151 9/10/2024
1.0.25 155 9/5/2024
1.0.24 172 8/24/2024
1.0.23 178 4/12/2024
1.0.22 167 3/13/2024
1.0.21 173 2/21/2024
1.0.20 152 2/16/2024
1.0.19 166 2/16/2024
1.0.18 176 2/6/2024
1.0.17 180 1/17/2024
1.0.16 171 1/15/2024
1.0.15 177 1/5/2024
1.0.14 166 1/5/2024
1.0.13 171 12/23/2023
1.0.12 162 12/14/2023
1.0.11 168 12/9/2023
1.0.10 150 12/6/2023
1.0.9 191 11/18/2023
1.0.8 158 11/14/2023
1.0.7 151 11/8/2023
1.0.6 152 11/2/2023
1.0.5 174 11/1/2023
1.0.4 149 11/1/2023
1.0.3 184 10/16/2023
1.0.2 186 10/13/2023
1.0.1 186 10/5/2023
1.0.0 167 10/5/2023
0.1.22 223 9/8/2023
0.1.21 200 9/5/2023
0.1.20 202 9/4/2023
0.1.19 207 8/31/2023
0.1.18 193 8/29/2023
0.1.17 192 8/21/2023
0.1.16 212 8/16/2023
0.1.15 223 8/4/2023
0.1.14 232 8/4/2023
0.1.13 249 7/15/2023
0.1.12 248 7/11/2023
0.1.11 242 7/7/2023
0.1.10 235 6/27/2023
0.1.9 250 6/13/2023
0.1.8 243 6/6/2023
0.1.7 252 6/2/2023
0.1.6 239 5/16/2023
0.1.5 273 4/18/2023
0.1.4 270 4/17/2023
0.1.3 283 4/17/2023