Tingle.Extensions.Logging 5.2.0

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

Tingle.Extensions.Logging

This library provides convenience extensions and logging in CLI applications.

The default console logger uses the Simple formatter by default but this includes the category and event id whereas in CLI applications we may not want them. This library contains a CliConsoleFormatter that make them optional.

For example, you can configure the Simple formatter as:

{
  "Logging": {
    "Console": {
      "FormatterName": "Simple",
      "FormatterOptions": {
        "SingleLine": true,
        "IncludeScopes": false,
        "TimestampFormat": "yyyy-MM-dd HH:mm:ss "
      }
    }
  }
}

The output would be:

2025-04-20 13:19:11 info: System.Net.Http.HttpClient.IpifyClient.LogicalHandler[100] Start processing HTTP request GET https://api64.ipify.org/?*
2025-04-20 13:19:11 info: System.Net.Http.HttpClient.IpifyClient.ClientHandler[100] Sending HTTP request GET https://api64.ipify.org/?*
2025-04-20 13:19:12 info: System.Net.Http.HttpClient.IpifyClient.ClientHandler[101] Received HTTP response headers after 553.3962ms - 200
2025-04-20 13:19:12 info: System.Net.Http.HttpClient.IpifyClient.LogicalHandler[101] End processing HTTP request after 568.9045ms - 200

Now you can configure the cli formatter as:

{
  "Logging": {
    "Console": {
      "FormatterName": "cli",
      "FormatterOptions": {
        "SingleLine": true,
        "IncludeScopes": false,
        "IncludeCategory": false,
        "IncludeEventId": false,
        "TimestampFormat": "yyyy-MM-dd HH:mm:ss "
      }
    }
  }
}
var builder = Host.CreateApplicationBuilder();
builder.Logging.AddCliConsole(); // pulls from config

// // or without config
// builder.Logging.AddCliConsole(options =>
// {
//   options.SingleLine = true;
//   options.TimestampFormat = "yyyy-MM-dd HH:mm:ss ";
// });

The output would be:

2025-04-20 13:19:11 info:  Start processing HTTP request GET https://api64.ipify.org/?*
2025-04-20 13:19:11 info:  Sending HTTP request GET https://api64.ipify.org/?*
2025-04-20 13:19:12 info:  Received HTTP response headers after 553.3962ms - 200
2025-04-20 13:19:12 info:  End processing HTTP request after 568.9045ms - 200

See sample.

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 is compatible.  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 is compatible.  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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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
5.2.0 2,276 4/21/2025
5.1.1 449 4/20/2025
5.1.0 161 4/20/2025