Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demystify Changes "\" to "/" #190

Open
LorneCash opened this issue Feb 15, 2022 · 1 comment
Open

Demystify Changes "\" to "/" #190

LorneCash opened this issue Feb 15, 2022 · 1 comment

Comments

@LorneCash
Copy link

After some testing I've found that Demystify converts traces to have forward-slashes "/" instead of the original back-slashes "" in paths. Please correct this or give me an option to not do this. See example traces below:

Trace Original:
at MyNamespace.Test.GenerateExceptions.Method03_6() in C:\DevOps\MySolution\MyNamespace.Test\TestMethods\GenerateExceptions_Method03_6.cs:line 9
at MyNamespace.Test.GenerateExceptions.Method03_5() in C:\DevOps\MySolution\MyNamespace.Test\TestMethods\GenerateExceptions_Method03_5.cs:line 7
at MyNamespace.Test.GenerateExceptions.Method03_4() in C:\DevOps\MySolution\MyNamespace.Test\TestMethods\GenerateExceptions_Method03_4.cs:line 7
at MyNamespace.Test.GenerateExceptions.Method03_3() in C:\DevOps\MySolution\MyNamespace.Test\TestMethods\GenerateExceptions_Method03_3.cs:line 13

Trace Demystified:
at void MyNamespace.Test.GenerateExceptions.Method03_6() in C:/DevOps/MySolution\MyNamespace.Test/TestMethods/GenerateExceptions_Method03_6.cs:line 9
at void MyNamespace.Test.GenerateExceptions.Method03_5() in C:/DevOps/MySolution\MyNamespace.Test/TestMethods/GenerateExceptions_Method03_5.cs:line 7
at void MyNamespace.Test.GenerateExceptions.Method03_4() in C:/DevOps/MySolution\MyNamespace.Test/TestMethods/GenerateExceptions_Method03_4.cs:line 7
at void MyNamespace.Test.GenerateExceptions.Method03_3() in C:/DevOps/MySolution\MyNamespace.Test/TestMethods/GenerateExceptions_Method03_3.cs:line 13

@potatopeelings
Copy link

I believe this is because of

return Uri.UnescapeDataString(uri.AbsolutePath);

If you use LocalPath instead of AbsolutePath, it would return the local operating-system representation which is what you are looking for (see https://docs.microsoft.com/en-us/dotnet/api/system.uri.localpath?view=net-6.0).

However if you decide (to fork and) do this change, and you are logging from both Windows and Linux, you will have a mix of / and \ separated paths

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants