VOOZH about

URL: https://www.nuget.org/packages/Destructurama.FSharp/

⇱ NuGet Gallery | Destructurama.FSharp 4.0.0




👁 Image
Destructurama.FSharp 4.0.0

dotnet add package Destructurama.FSharp --version 4.0.0
 
 
NuGet\Install-Package Destructurama.FSharp -Version 4.0.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="Destructurama.FSharp" Version="4.0.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Destructurama.FSharp" Version="4.0.0" />
 
Directory.Packages.props
<PackageReference Include="Destructurama.FSharp" />
 
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 Destructurama.FSharp --version 4.0.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Destructurama.FSharp, 4.0.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 Destructurama.FSharp@4.0.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=Destructurama.FSharp&version=4.0.0
 
Install as a Cake Addin
#tool nuget:?package=Destructurama.FSharp&version=4.0.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Destructurama.FSharp

ATTENTION! Looking for maintainers

See https://github.com/destructurama/fsharp/issues/34

👁 License

👁 codecov
👁 Nuget
👁 Nuget

👁 GitHub Release Date
👁 GitHub commits since latest release (by date)
👁 Size

👁 GitHub contributors
👁 Activity
👁 Activity
👁 Activity

👁 Run unit tests
👁 Publish preview to GitHub registry
👁 Publish release to Nuget registry

Native support for destructuring F# types when logging to Serilog.

Installation

Install from NuGet:

dotnet add package Destructurama.FSharp

Usage

Add Destructure.FSharpTypes() to your logger configuration:

open Serilog

[<EntryPoint>]
let main argv = 

 Log.Logger <- LoggerConfiguration()
 .Destructure.FSharpTypes()
 .WriteTo.Console()
 .CreateLogger()

 Log.Information("Drawing a {@Shape}", Circle 5.)

 0

Discriminated unions like:

type Shape =
 | Circle of Radius : double
 | Rectangle of Width : double * Height : double
 | Arc // ...
let shape = Circle 5.

When logged with Serilog:

Log.Information("Drawing a {@Shape}", shape)

Are printed nicely like:

2015-01-14 16:58:31 [Information] Drawing a Circle { Radius: 5 }

Depending on the log storage you use you will be able to query on the tag as well as the fields (like Radius) from the union.

More samples can be seen by running the project in the Samples folder using dotnet run. Doing so will destructure a union, record, and a tuple with and without this package to highlight the difference:

➜ samples git:(records) ✗ dotnet run
[13:35:19 INF] Printing a {"quantity": 10, "label": "hi", "Tag": 2, "IsA": false, "IsB": false, "IsC": true, "$type": "C"} with poor destructuring
[13:35:19 INF] Printing a {"quantity": 10, "label": "hi", "$type": "C"} with better destructuring

[13:35:19 INF] Printing a {"FieldA": 10, "OtherField": true, "AnotherOne": {"quantity": 10, "label": "hi", "Tag": 2, "IsA": false, "IsB": false, "IsC": true, "$type": "C"}, "$type": "MyRecord"} with poor destructuring
[13:35:19 INF] Printing a {"FieldA": 10, "OtherField": true, "AnotherOne": {"quantity": 10, "label": "hi", "$type": "C"}, "$type": "MyRecord"} with better destructuring

[13:35:19 INF] Printing a {"Item1": 1, "Item2": "hi", "$type": "Tuple`2"} with poor destructuring
[13:35:19 INF] Printing a [1, "hi"] with better destructuring
Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 was computed.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Destructurama.FSharp:

Package Downloads
Serilog.Extras.FSharp

Obsolete. Please install Destructurama.FSharp.

Exira.EbsBackup

Exira.EbsBackup is a console application which backs up EBS volumes on a rotating schedule

Monazita

An F# library to query your Postgresql database writing sql queries using a printf format.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0 1,914 1/9/2026
3.0.1 40,172 12/16/2024
3.0.0 2,981 12/15/2024
2.0.0 118,766 1/30/2024
1.2.0 257,628 9/30/2021
1.2.0-dev-00047 531 9/20/2021
1.1.2-dev-00045 2,830 7/14/2021
1.1.1-dev-00043 68,892 5/11/2021
1.1.1-dev-00042 434 5/11/2021
1.1.1-dev-00035 67,204 1/14/2020
1.1.1-dev-00033 61,770 10/30/2019
1.1.0 17,271 10/29/2019
1.1.0-dev-00025 634 10/29/2019
1.1.0-dev-00023 3,722 8/11/2019
1.0.14 106,428 6/8/2015
1.0.13 1,470 6/8/2015
1.0.10 1,524 6/7/2015
1.0.8 1,511 6/6/2015
1.0.6 1,650 4/1/2015
1.0.5 1,557 3/29/2015
Loading failed