Improve productivity and debuggability by adding .Dump()
extension methods to Console Applications.
Dump
any object in a structured and colorful way into the Console, Trace, Debug events or your own custom output.
One of my favorites LinqPad feature is its .Dump()
extension methods and how customizable they are. It was always hard to return to Visual Studio, VSCode, Rider, or any other IDE/Editor and find out this feature doesn't exist there.
The library is published as a Nuget
Either run dotnet add package Dumpify
, Install-Package Dumpify
or use Visual Studio's NuGet Package Manager
- Dump any object in a structured, colorful way to Console, Debug, Trace or any other custom output
- Support Properties, Fields and non-public members
- Support max nesting levels
- Support circular dependencies and references
- Support styling and customizations
- Highly Configurable
- Fast!
- Support for differnt otuput target:
- Console
- Trace
- Debug
- Text
- Custom
new { Name = "Dumpify", Description = "Dump any object to Console" }.Dump();
Support nesting as well
var moaid = new Person { FirstName = "Moaid", LastName = "Hathot" };
var haneeni = new Person { FirstName = "Haneeni", LastName = "Shibli" };
moaid.Spouse = haneeni;
haneeni.Spouse = moaid;
moaid.Dump();
Support for special types like arrays and Dictionaries
var arr = new[] { 1, 2, 3, 4 }.Dump();
var arr2d = new int[,] { {1, 2}, {3, 4} }.Dump();
new Dictionary<string, string>
{
["Moaid"] = "Hathot",
["Haneeni"] = "Shibli",
["Eren"] = "Yeager",
["Mikasa"] = "Ackerman",
}.Dump();
- Add configuration for formatting Anonymous Objects type names
- Cache Spectre.Console styles and colors
- Text renderer
- Consider disabling wrapping of Table titles
- re-introduce labels
- Better styling of Custom values
- Typeof(T) for example, Generic types, etc.
- Better rendering of Delegates
- Live outputs
- Add custom rendering for more types:
- DataTable & DataSets
- Exceptions, AggregateExceptions, etc...
- Rethink Generators caching keys
- Consider using Max Depth for Descriptors
- Refactor Renderers and make it better extendable
- Add more renderers
- Text Renderers
- re-introduce Json
- CSharp Renderer
- Consider Decoupling from Spectre.Console
- Tests
- More tests
- Visual (Render) Tests - consider acceptance tests
- Tests for Nesting
- More sync between Custom Descriptors and Custom Renderers
- Think how we can mark type's descriptor as needing special rendering.
- The current CustomDescriptorGenerator must generate a value
- Consider ValueTuple
- Refactor SpectureTableRenderer to share customization code
- Consider changing the style/view of ObjectDescriptors without properties (currently empty table)