benaadams / Ben.Demystifier

High performance understanding for stack traces (Make error logs more productive)
Apache License 2.0
2.76k stars 118 forks source link

Improve StackTraceHiddenAttribute handling #83

Closed onyxmaster closed 5 years ago

onyxmaster commented 5 years ago

This PR partially addresses #71, making the exception possible only in the reflection-only assembly case ona a .NET Core 2.1+ runtime. It also explicitly differentiates runtimes based on the presence of the StackTraceHiddenAttribute type and uses the runtime type to compare, when the tested member is not reflection-only. I'm not sure if stack traces from reflection-only assemblies are really possible in a running application, but I left the fallback case using GetCustomAttributesData for this specific case. I also added netcoreapp2.1 targets to tests and benchmarks to be able to test the StackTraceHiddenAttribute handling explicitly since it was introduced in 2.1. The benchmarks also show minor performance and allocation improvements, will post the details if needed.

benaadams commented 5 years ago

Thank you!

benaadams commented 5 years ago

https://www.nuget.org/packages/Ben.Demystifier/0.1.4