QuickPulse.Show
0.1.0
See the version list below for details.
dotnet add package QuickPulse.Show --version 0.1.0
NuGet\Install-Package QuickPulse.Show -Version 0.1.0
<PackageReference Include="QuickPulse.Show" Version="0.1.0" />
<PackageVersion Include="QuickPulse.Show" Version="0.1.0" />
<PackageReference Include="QuickPulse.Show" />
paket add QuickPulse.Show --version 0.1.0
#r "nuget: QuickPulse.Show, 0.1.0"
#:package QuickPulse.Show@0.1.0
#addin nuget:?package=QuickPulse.Show&version=0.1.0
#tool nuget:?package=QuickPulse.Show&version=0.1.0
QuickPulse.Show
Please allow
this
to introduce oneself, hope you guess my type.
Introduce.This(new List<Person> { new("Alice", 26), new("Bob", 21) }, false);
// => "[ { Name: \"Alice\", Age: 26 }, { Name: \"Bob\", Age: 21 } ]"
Erm, ... well, ... I guess we're done here, ...
That's it really, ... One method.
Oh and the optional false
parameter renders the output on one line.
So yeah there's that.
Or ... would you like to know more ?
Purpose
QuickPulse.Show provides lightweight, opinionated, pretty-printing honest-printing for diagnostics, debugging, and testing. It's not a general-purpose serializer, it's meant to give you a clean, readable snapshot of values as they flow through your code.
The Interface Definition Contract (sic)
The method components are described below for implementers and consumers requiring integration-level understanding.
Adding false
to the Introduce.This(...)
method disables multi-line printing (which is the current default).
Output Style
The output follows a C#-inspired, developer-friendly style:
- Objects use
{ Prop: Value }
syntax - Strings are quoted
- Primitives render as-is
- Collections render in square brackets:
[ ... ]
- Tuples and anonymous types print with parentheses or braces respectively
- Null prints as
null
Introduce.This(123); // => "123"
Introduce.This("hi"); // => "\"hi\""
Introduce.This(new[] { 1, 2 }); // => "[ 1, 2 ]"
Introduce.This((1, "a")); // => "(1, \"a\")"
Introduce.This(new { X = 1, Y = "Z" }); // => "{ X: 1, Y: \"Z\" }"
Introduce.This(null); // => "null"
Supported Types
Formatting is recursive, but avoids circular reference handling.
The formatter supports:
- Primitive types (
int
,bool
, etc.) - Strings
null
- Arrays and any
IEnumerable
- Tuples (up to 7 elements)
- Records and anonymous types
- User-defined classes and structs, best effort. Which means I tried to break it:
From PrettyCollectionTests.cs:Pulse_IntList
Pulse_NestedList_IndentedCorrectly
Pulse_ObjectList
Pulse_ListContainingEmptyObject
Pulse_ListOfNulls
Pulse_ListOfTuplesWithNulls
Pulse_ListWithEmptyDictionary
Pulse_ListOfPolymorphicObjects
Pulse_ListOfNestedPolymorphicObjects
Pulse_ShapeCollisionInPolymorphicList
I'm sure I missed something so I'm gonna keep trying.
And if you can break it, ... create an issue, ... make my day.
Customization
Currently, Introduce.This
is not configurable. Future versions will support:
- Maximum depth / length controls.
- Custom format hooks per type.
- Fine grained control over object properties (Ignore, Customize, ...).
For now, it's designed to Just Work for 90% of debugging needs.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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 was computed. 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. |
-
net8.0
- QuickPulse (>= 0.1.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on QuickPulse.Show:
Package | Downloads |
---|---|
QuickAcid
Drop it in acid. Look for gold. Like alchemy, but reproducible. |
GitHub repositories
This package is not used by any popular GitHub repositories.