{"id":13457931,"url":"https://github.com/MoaidHathot/Dumpify","last_synced_at":"2025-03-24T14:32:29.373Z","repository":{"id":153181729,"uuid":"618183601","full_name":"MoaidHathot/Dumpify","owner":"MoaidHathot","description":"Adding `.Dump()` extension methods to Console Applications, similar to LinqPad's.","archived":false,"fork":false,"pushed_at":"2025-01-28T17:35:48.000Z","size":2692,"stargazers_count":1054,"open_issues_count":11,"forks_count":43,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-03-23T12:58:31.606Z","etag":null,"topics":["ansci","console-application","csharp","debugging","dotnet","instrumentation","logging","nuget","serialization"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MoaidHathot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-23T23:29:14.000Z","updated_at":"2025-03-21T18:36:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"d5e50737-53fd-41d4-9304-ea369a046e64","html_url":"https://github.com/MoaidHathot/Dumpify","commit_stats":{"total_commits":163,"total_committers":10,"mean_commits":16.3,"dds":0.2760736196319018,"last_synced_commit":"2028e37e64fc733a892c101936ab3449c39590ff"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoaidHathot%2FDumpify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoaidHathot%2FDumpify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoaidHathot%2FDumpify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoaidHathot%2FDumpify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoaidHathot","download_url":"https://codeload.github.com/MoaidHathot/Dumpify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245289720,"owners_count":20591121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansci","console-application","csharp","debugging","dotnet","instrumentation","logging","nuget","serialization"],"created_at":"2024-07-31T09:00:39.938Z","updated_at":"2025-03-24T14:32:29.365Z","avatar_url":"https://github.com/MoaidHathot.png","language":"C#","readme":"# Dumpify\n\u003cimg src=\"https://raw.githubusercontent.com/MoaidHathot/Dumpify/main/assets/Dumpify-logo-styled.png\" alt=\"drawing\" width=\"200\" /\u003e\n\n[![Github version](https://badge.fury.io/nu/Dumpify.svg)](https://badge.fury.io/nu/Dumpify)\n![example workflow](https://github.com/MoaidHathot/Dumpify/actions/workflows/build-dumpify.yml/badge.svg)\n![Publish Nuget](https://github.com/MoaidHathot/Dumpify/actions/workflows/publish-dumpify.yml/badge.svg)\n![Nuget Downloads](https://img.shields.io/nuget/dt/Dumpify)\n![GitHub Repo stars](https://img.shields.io/github/stars/MoaidHathot/Dumpify)\n![GitHub License](https://img.shields.io/github/license/MoaidHathot/Dumpify)\n\nImprove productivity and debuggability by adding `.Dump()` extension methods to **Console Applications**.\n`Dump` any object in a structured and colorful way into the Console, Trace, Debug events or your own custom output.\n\n# How to Install\nThe library is published as a [Nuget](https://www.nuget.org/packages/Dumpify)\n\nEither run `dotnet add package Dumpify`, `Install-Package Dumpify` or use Visual Studio's [NuGet Package Manager](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio)\n\n# Overview Video\n An overview video hosted on the `Open at Microsoft` show\u003cbr\u003e\u003cbr\u003e\n\u003ca href=\"https://www.youtube.com/watch?v=ERWAMSgz-vc\"\u003e\n\t\u003cimg src = \"https://github.com/MoaidHathot/Dumpify/assets/8770486/2fcdc3eb-1c09-465a-99ba-19c267565bea\" width = \"400\" /\u003e\n\u003cbr\u003e\t\n\u003c/a\u003e\n\n![https://www.youtube.com/watch?v=ERWAMSgz-vc](https://www.youtube.com/watch?v=ERWAMSgz-vc)\n\n\n\n# Features\n* Dump any object in a structured, colorful way to Console, Debug, Trace or any other custom output\n* Support Properties, Fields and non-public members\n* Support max nesting levels\n* Support circular dependencies and references\n* Support styling and customizations\n* Highly Configurable\n* Support for different output targets: Console, Trace, Debug, Text, Custom\n* Fast!\n    \n# Examples:\n## Anonymous types\n```csharp\nnew { Name = \"Dumpify\", Description = \"Dump any object to Console\" }.Dump();\n```\n![image](https://user-images.githubusercontent.com/8770486/232251633-5830bd48-0e45-4c89-9b26-3c678230a90a.png)\n\n\n### Support nesting and circular references\n```csharp\nvar moaid = new Person { FirstName = \"Moaid\", LastName = \"Hathot\", Profession = Profession.Software };\nvar haneeni = new Person { FirstName = \"Haneeni\", LastName = \"Shibli\", Profession = Profession.Health };\n\nmoaid.Spouse = haneeni;\nhaneeni.Spouse = moaid;\n\nmoaid.Dump();\n//You can define max depth as well, e.g `moaid.Dump(maxDepth: 2)`\n```\n![image](https://user-images.githubusercontent.com/8770486/232280616-c6127820-7e2b-448b-81ca-1aded2894cdc.png)\n\n### Support for Arrays, Dictionaries and Collections\n```csharp\nvar arr = new[] { 1, 2, 3, 4 }.Dump();\n```\n![image](https://user-images.githubusercontent.com/8770486/232251833-ef2650fe-64a3-476d-b676-4a0f73339560.png)\n\n```csharp\nvar arr2d = new int[,] { {1, 2}, {3, 4} }.Dump();\n```\n![image](https://user-images.githubusercontent.com/8770486/230250735-66703e54-ce02-41c0-91b7-fcbee5f80ac3.png)\n\n```csharp\nnew Dictionary\u003cstring, string\u003e\n{\n   [\"Moaid\"] = \"Hathot\",\n   [\"Haneeni\"] = \"Shibli\",\n   [\"Eren\"] = \"Yeager\",\n   [\"Mikasa\"] = \"Ackerman\",\n}.Dump();\n```\n![image](https://user-images.githubusercontent.com/8770486/232251913-add4a0d8-3355-44f6-ba94-5dfbf8d8e2ac.png)\n\nYou can ensure that arrays, dictionaries and collections don't output too much by allowing results to be truncated. Do this by setting the `MaxCollectionCount` property in the tableConfig.\n\n```csharp\nint[] arr = [1, 2, 3, 4];\n\n// Outputs only the first two elements and a message that says: ... truncated 2 items\narr.Dump(tableConfig: new () { MaxCollectionCount = 2 });\n```\n\n### You can turn on or off fields and private members\n```csharp\npublic class AdditionValue\n{\n    private readonly int _a;\n    private readonly int _b;\n\n    public AdditionValue(int a, int b)\n    {\n        _a = a;\n        _b = b;\n    }\n\n    private int Value =\u003e _a + _b;\n}\n\n\nnew AdditionValue(1, 2).Dump(members: new MembersConfig { IncludeFields = true, IncludeNonPublicMembers = true });\n```\n![image](https://user-images.githubusercontent.com/8770486/232252840-c5b0ea4c-eae9-4dc2-bd6c-d42ee58505eb.png)\n\n### You can provide a custom filter to determine if members should be included or not\n```csharp\npublic class Person\n{\n    public string Name { get; set; }\n\n    [JsonIgnore]\n    public string SensitiveData { get; set; }\n}\n\nnew Person()\n{\n    Name = \"Moaid\",\n    SensitiveData = \"We don't want this to show up\"\n}.Dump(members: new MembersConfig { MemberFilter = member =\u003e !member.Info.CustomAttributes.Any(a =\u003e a.AttributeType == typeof(JsonIgnoreAttribute)) });\n```\n\n### You can turn on or off row separators and a type column\n```csharp\n//globally\nDumpConfig.Default.TableConfig.ShowMemberTypes = true;\nDumpConfig.Default.TableConfig.ShowRowSeparators = true;\n\nnew { Name = \"Dumpify\", Description = \"Dump any object to Console\" }.Dump();\n\n//or Per dump\nnew { Name = \"Dumpify\", Description = \"Dump any object to Console\" }.Dump(tableConfig: new TableConfig { ShowRowSeparators = true, ShowMemberTypes = true });\n```\n![image](https://raw.githubusercontent.com/MoaidHathot/Dumpify/main/assets/screenshots/row-separator.png)\n\n### You can set custom labels or auto-labels\n```csharp\nnew { Description = \"You can manually specify labels to objects\" }.Dump(\"Manual label\");\n\n//Set auto-label globally for all dumps if a custom label wasn't provider\nDumpConfig.Default.UseAutoLabels = true;\nnew { Description = \"Or set labels automatically with auto-labels\" }.Dump();\n```\n![image](https://raw.githubusercontent.com/MoaidHathot/Dumpify/main/assets/screenshots/custom-label-and-auto-labels.png)\n\n### You can customize colors\n```csharp\nvar package = new { Name = \"Dumpify\", Description = \"Dump any object to Console\" };\npackage.Dump(colors: ColorConfig.NoColors);\npackage.Dump(colors: new ColorConfig { PropertyValueColor = new DumpColor(Color.RoyalBlue)});\n```\n![image](https://user-images.githubusercontent.com/8770486/232252235-18d43c3a-0b54-475a-befc-0f957777f150.png)\n\n### You can turn on or off type names, headers, lables and much more\n```csharp\nvar moaid = new Person { FirstName = \"Moaid\", LastName = \"Hathot\", Profession = Profession.Software };\nvar haneeni = new Person { FirstName = \"Haneeni\", LastName = \"Shibli\", Profession = Profession.Health };\nmoaid.Spouse = haneeni;\nhaneeni.Spouse = moaid;\n\nmoaid.Dump(typeNames: new TypeNamingConfig { ShowTypeNames = false }, tableConfig: new TableConfig { ShowTableHeaders = false });\n```\n![image](https://user-images.githubusercontent.com/8770486/232252319-58a98036-5a0e-4514-8d08-df6fdff5a8a7.png)\n\n\n### There are multiple output options (Console, Trace, Debug, Text) or provide your own\n```csharp\nvar package = new { Name = \"Dumpify\", Description = \"Dump any object to Console\" };\npackage.Dump(); //Similar to `package.DumpConsole()` and `package.Dump(output: Outputs.Console))`\npackage.DumpDebug(); //Dump to Visual Studio's Debug source\npackage.DumpTrace(); //Dump to Trace \nvar text = package.DumpText(); //The table in a text format\n\nusing var writer = new StringWriter();\npackage.Dump(output: new DumpOutput(writer)); //Custom output\n```\n\n\n### Every configuration can be defined per-Dump or globally for all Dumps, e.g:\n```csharp\nDumpConfig.Default.TypeNamingConfig.UseAliases = true;\nDumpConfig.Default.TypeNamingConfig.ShowTypeNames = false;\nDumpConfig.Default.ColorConfig.TypeNameColor = Color.Gold;\nDumpConfig.Default.MaxDepth = 3;\n//Much more...\n```\n\n\n\n# Features for the future 0.7.0 release\n* Add configuration for formatting Anonymous Objects type names\n* Text renderer\n* Better rendering of Delegates\n* Write the `Count` values of dictionaries and IEnumerables in the name, e.g `Dictionary\u003cstring, string\u003e(3)`\n* Add an option to limit how many elements to render for collections and arrays.\n* **consider** changing the default color scheme to VSCode's\n* Documentation\n* Consider changing the style/view of ObjectDescriptors without properties (currently empty table)\n* Fix simplified type names with Collection expressions (IEnumearble\u003cint\u003e col = [1, 2, 3]);\n\n# To do\n* Live outputs\n* Add custom rendering for more types:\n    - Exceptions, AggregateExceptions, etc...\n* Rethink Generators caching keys\n* Consider using Max Depth for Descriptors\n* Refactor Renderers and make it better extendable\n* Add more renderers\n    * Text Renderers\n    * re-introduce Json\n    * CSharp Renderer\n* Consider Decoupling from Spectre.Console\n* Tests\n    * More tests\n    * Visual (Render) Tests - consider acceptance tests\n    * Tests for Nesting\n* More sync between Custom Descriptors and Custom Renderers\n\t* Think how we can mark type's descriptor as needing special rendering.\n\t* The current CustomDescriptorGenerator must generate a value\n\t* Consider ValueTuple\n* Refactor SpectureTableRenderer to share customization code\n","funding_links":[],"categories":["C\\#","C#","dotnet","C# #"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMoaidHathot%2FDumpify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMoaidHathot%2FDumpify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMoaidHathot%2FDumpify/lists"}