Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Sentry.Unity.Native/SentryNativeBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ is RuntimePlatform.WindowsPlayer or RuntimePlatform.WindowsServer
{
Logger?.LogDebug("Setting the native logger");
sentry_options_set_logger(cOptions, new sentry_logger_function_t(nativeLog), IntPtr.Zero);

// Crash handlers must not invoke Unity's managed logger from the faulting thread.
sentry_options_set_logger_enabled_when_crashed(cOptions, 0);
}
else
{
Expand Down Expand Up @@ -214,6 +217,9 @@ internal static string GetDatabasePath(SentryUnityOptions options, IApplication?
[DllImport(SentryLib)]
private static extern void sentry_options_set_logger(IntPtr options, sentry_logger_function_t logger, IntPtr userData);

[DllImport(SentryLib)]
private static extern void sentry_options_set_logger_enabled_when_crashed(IntPtr options, int enabled);

// This method is called from the C library and forwards incoming messages to the currently set _logger.
[MonoPInvokeCallback(typeof(sentry_logger_function_t))]
private static void nativeLog(int cLevel, IntPtr format, IntPtr args, IntPtr userData)
Expand Down
Loading