Mingmoe.Demystifier 0.9.9

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

Utopia.Demystifier

NuGet version (Ben.Demystifier) build

Print your exceptions gracefully!

FEATURE:

  • Use ZString
  • Detailed frame stack information.
  • Colored(and you can customize it) string.

Like:

Original stacktrace Demystified stacktrace Colored demystified stacktrace

Usage

// print to console(stdout)
exception.PrintColoredStringDemystified();

// or print it by yourself!
string msg = exception.ToColoredStringDemystified();

// OR
// save colored amd demystified string to exception
// NOTE:this may cause something not be colored.
exception.ColoredDemystify();

// you can customize your own style!
using Mingmoe.Demystifier;

StyledBuilderOption option = new StyledBuilderOption();
option.shortenSourceFilePath = false;
option.SourcePathStyle.BackgroundColor = Color.Red;
option.ParamNameStyle.ForeColor = new Color(128, 128, 128);
option.ParamTypeStyle.isBold = true;

// apply it
ex.PrintColoredStringDemystified(option);
ex.ToColoredStringDemystified(option);
ex.ColoredDemystify(option);

// or save it as an global and default option
// StyledBuilderOption.GlobalOption = option;
// ex.PrintColoredStringDemystified(); 
// ex.ToColoredStringDemystified()
// ex.ColoredDemystify();

Origin function from Ben.Demystifier should works.

Problems with current stack traces:

  • constructors

    Does not match code, output as .ctor and .cctor

  • parameters

    Do not specify qualifier ref, out or in

  • iterators

    Cannot determine overload <Iterator>d__3.MoveNext() rather than Iterator(int startAt)+MoveNext()

  • Linq

    Cannot determine overload

    Linq.Enumerable.SelectEnumerableIterator``2.MoveNext()

    rather than

    Linq.Enumerable+SelectEnumerableIterator<TSource, TResult>.MoveNext()

  • async

    Cannot determine overload and no modifier such as async

    <MethodAsync>d__5``1.MoveNext()

    rather than

    async Task<string> Program.MethodAsync(int value)

    Noise!

    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.GetResult() 
    
  • lambdas

    Mostly jibberish <>c__DisplayClass2_0.<.ctor>b__0(Object state) with a suggestion of where they are declared but no hint if there are multiple overloads of the method.

  • local functions

    Mostly jibberish <RefMethod>g__LocalFuncParam|10_0(String val, <>c__DisplayClass10_0& ) with a suggestion of where they are declared but no hint if there are multiple overloads of the method.

  • generic parameters

    Not resolved, only an indication of the number RunLambda(Func``1 lambda) rather than RunLambda(Func<string> lambda)

  • value tuples

    Do not match code, output as ValueTuple``2 param rather than (string val, bool) param

  • primitive types

    Do not match code, output as Int64, Boolean, String rather than long, bool, string

  • return types

    Skipped entirely from method signature

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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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
0.9.9 7,238 4/5/2024