getsentry / sentry-xamarin

Sentry for Xamarin Native and Xamarin.Forms
https://docs.sentry.io/platforms/dotnet/guides/xamarin/
44 stars 11 forks source link

Avoid repeat initialization #130

Closed mattjohnsonpint closed 1 year ago

mattjohnsonpint commented 1 year ago

Fixes #129 by automatically preventing multiple initialization. Writes a message to stderr accordingly.

Will continue pursuing a fix for the root cause in https://github.com/getsentry/sentry-dotnet/issues/2033.

mattjohnsonpint commented 1 year ago

@lucas-zimerman - Please let me know if you think there's a better place to write the error message at this stage. Thanks.

lucas-zimerman commented 1 year ago

Console error is ok,l it'll end up showing on logcat or on the IDE Logger. My only concern on using the SentrySdk.IsEnabled check is if we should clear the past data (breadcrumbs, context, tags) EDIT: Other than that the PR looks good for me.