Psimsa.TinyLogger
0.1.5
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Psimsa.TinyLogger --version 0.1.5
NuGet\Install-Package Psimsa.TinyLogger -Version 0.1.5
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="0.1.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Psimsa.TinyLogger --version 0.1.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Psimsa.TinyLogger, 0.1.5"
#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 Psimsa.TinyLogger as a Cake Addin
#addin nuget:?package=Psimsa.TinyLogger&version=0.1.5
// Install Psimsa.TinyLogger as a Cake Tool
#tool nuget:?package=Psimsa.TinyLogger&version=0.1.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 (unlikeLoggerFactory.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.1)
- 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 intest
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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 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. |
.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.
-
.NETStandard 2.0
- Microsoft.Extensions.Logging.Abstractions (>= 7.0.0)
- System.Text.Json (>= 7.0.2)
-
net6.0
- Microsoft.Extensions.Logging.Abstractions (>= 7.0.0)
-
net7.0
- Microsoft.Extensions.Logging.Abstractions (>= 7.0.0)
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.23 | 99 | 4/12/2024 |
1.0.22 | 93 | 3/13/2024 |
1.0.21 | 89 | 2/21/2024 |
1.0.20 | 85 | 2/16/2024 |
1.0.19 | 85 | 2/16/2024 |
1.0.18 | 95 | 2/6/2024 |
1.0.17 | 108 | 1/17/2024 |
1.0.16 | 97 | 1/15/2024 |
1.0.15 | 102 | 1/5/2024 |
1.0.14 | 92 | 1/5/2024 |
1.0.13 | 103 | 12/23/2023 |
1.0.12 | 90 | 12/14/2023 |
1.0.11 | 94 | 12/9/2023 |
1.0.10 | 99 | 12/6/2023 |
1.0.9 | 130 | 11/18/2023 |
1.0.8 | 92 | 11/14/2023 |
1.0.7 | 93 | 11/8/2023 |
1.0.6 | 107 | 11/2/2023 |
1.0.5 | 113 | 11/1/2023 |
1.0.4 | 97 | 11/1/2023 |
1.0.3 | 114 | 10/16/2023 |
1.0.2 | 119 | 10/13/2023 |
1.0.1 | 120 | 10/5/2023 |
1.0.0 | 102 | 10/5/2023 |
0.1.22 | 139 | 9/8/2023 |
0.1.21 | 125 | 9/5/2023 |
0.1.20 | 125 | 9/4/2023 |
0.1.19 | 127 | 8/31/2023 |
0.1.18 | 114 | 8/29/2023 |
0.1.17 | 115 | 8/21/2023 |
0.1.16 | 124 | 8/16/2023 |
0.1.15 | 140 | 8/4/2023 |
0.1.14 | 150 | 8/4/2023 |
0.1.13 | 155 | 7/15/2023 |
0.1.12 | 163 | 7/11/2023 |
0.1.11 | 165 | 7/7/2023 |
0.1.10 | 150 | 6/27/2023 |
0.1.9 | 160 | 6/13/2023 |
0.1.8 | 149 | 6/6/2023 |
0.1.7 | 155 | 6/2/2023 |
0.1.6 | 147 | 5/16/2023 |
0.1.5 | 180 | 4/18/2023 |
0.1.4 | 169 | 4/17/2023 |
0.1.3 | 191 | 4/17/2023 |