Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
- `SetBeforeCaptureViewHierarchy` signature changed from `Func<bool>` to `Func<SentryEvent, bool>`, now receiving the event that
triggered the view hierarchy capture. This allows context-aware decisions before capture begins. ([#2429](https://github.com/getsentry/sentry-unity/pull/2429))

### Fixes

- When targeting Windows or Linux with Mono as the scripting backend, to prevent crashes, the native SDK's debug logger integration is disabled. ([#2445](https://github.com/getsentry/sentry-unity/pull/2445))

### Features

- Added PlayStation Native Support. The SDK now automatically syncs the scope - tags, breadcrumbs, context - to the native layer, so native crashes have the same rich context as managed events. ([#2433](https://github.com/getsentry/sentry-unity/pull/2433))
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -605,4 +605,4 @@ void PrintFailedTests(XElement element)
<Message Importance="High" Text="Restoring package-dev/Plugins to the latest git commit" />
<Exec WorkingDirectory="$(RepoRoot)" Command="git restore package-dev/Plugins" />
</Target>
</Project>
</Project>
10 changes: 8 additions & 2 deletions src/Sentry.Unity.Native/Sentry.Unity.Native.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@
<ProjectReference Include="../Sentry.Unity/Sentry.Unity.csproj" Private="false" />
</ItemGroup>

<!-- Build Console version after the Desktop version -->
<Target Name="BuildConsoleAssembly" AfterTargets="AfterBuild">
<!-- Build PlayStation version after the main build -->
<Target Name="BuildPlayStationAssembly" AfterTargets="AfterBuild">
<Message Importance="High" Text="Building PlayStation-specific native assembly." />

<Csc
Sources="@(Compile)"
References="@(ReferencePath)"
OutputAssembly="$(OutDir)Sentry.Unity.Native.PlayStation.dll"
DefineConstants="$(DefineConstants);SENTRY_NATIVE_PLAYSTATION"
TargetType="library"
EmitDebugInformation="true"
Nullable="$(Nullable)"
LangVersion="$(LangVersion)"
TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
WarningLevel="$(WarningLevel)"
/>
</Target>

Expand Down
13 changes: 10 additions & 3 deletions src/Sentry.Unity.Native/SentryNativeBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,16 @@ is RuntimePlatform.LinuxPlayer or RuntimePlatform.LinuxServer
}
else
{
options.DiagnosticLogger.LogDebug($"{(_logger is null ? "Setting a" : "Replacing the")} native logger");
_logger = options.DiagnosticLogger;
sentry_options_set_logger(cOptions, new sentry_logger_function_t(nativeLog), IntPtr.Zero);
if (options.UnityInfo.IL2CPP)
{
options.DiagnosticLogger.LogDebug($"{(_logger is null ? "Setting a" : "Replacing the")} native logger");
_logger = options.DiagnosticLogger;
sentry_options_set_logger(cOptions, new sentry_logger_function_t(nativeLog), IntPtr.Zero);
}
else
{
options.DiagnosticLogger.LogInfo("Passing the native logs back to the C# layer is not supported on Mono - skipping native logger.");
}
}

options.DiagnosticLogger?.LogDebug("Initializing sentry native");
Expand Down