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

Fix bug with pre-formatted strings passed to diagnostic loggers #2004

Merged
merged 6 commits into from Oct 19, 2022

Conversation

mattjohnsonpint
Copy link
Contributor

@mattjohnsonpint mattjohnsonpint commented Oct 19, 2022

Resolves an issue in the diagnostic loggers caused when .NET's String.Format is invoked on a pre-formatted string that contains characters that could be interpreted as formatting characters. For example, "{foo:bar}" passed as a message would raise a FormatException.

This was most obvious on Android, when something logged from the native Android SDK that contained arguments was passed upstream to the .NET diagnostic logger. Accordingly, this PR fixes #2000.

Also with this PR:

  • When initializing the Android SDK, don't hook a logger if we aren't logging with SentryOptions.Debug == true
  • Update InternalsVisibleTo to ensure we can use the Sentry Android/Cocoa bindings in our unit tests
  • Some refactoring/renaming

The AndroidDiagnosticLoggerTests is also the first that is strictly platform-specific, running only with device tests. The infrastructure of which was created with #2002.

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

Successfully merging this pull request may close these issues.

Sentry for .net MAUI causes app crash upon startup
2 participants