Skip to content

Commit

Permalink
Unreal Engine plugin documentation update (#7626)
Browse files Browse the repository at this point in the history
  • Loading branch information
tustanivsky committed Aug 18, 2023
1 parent 66db699 commit 728eae3
Show file tree
Hide file tree
Showing 25 changed files with 96 additions and 46 deletions.
30 changes: 30 additions & 0 deletions src/platform-includes/configuration/before-send/unreal.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
```cpp
UCLASS()
class USomeBeforeSendHandler : public USentryBeforeSendHandler
{
GENERATED_BODY()

public:
virtual USentryEvent* HandleBeforeSend_Implementation(USentryEvent* Event, USentryHint* Hint) override
{
UE_LOG(LogTemp, Log, TEXT("Hello from CPP beforeSend handler"));
return Super::HandleBeforeSend_Implementation(Event, Hint);
}
};

...

FConfigureSettingsDelegate SettingsDelegate;
SettingsDelegate.BindDynamic(this, &USomeClass::HandleSettingsDelegate);

void USomeClass::HandleSettingsDelegate(USentrySettings* Settings)
{
Settings->BeforeSendHandler = USomeBeforeSendHandler::StaticCLass();
}

...

USentrySubsystem* SentrySubsystem = ...;

SentrySubsystem->InitializeWithSettings(SettingsDelegate);
```
9 changes: 9 additions & 0 deletions src/platform-includes/configuration/config-intro/unreal.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
In order to provide native crash support, the Sentry SDK for Unreal Engine includes platform-specific SDKs, such as [Android](/platforms/android/), [Apple](/platforms/apple/), and [Native](/platforms/native/). Those SDKs share the options with which they get initialized.

The UE layer self-initializes through the use of the [UGameInstance](https://docs.unrealengine.com/5.2/en-US/API/Runtime/Engine/Engine/UGameInstance/) subsystem.

<Note>

Not all options can be used on all platforms.

</Note>
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@ USentrySubsystem* SentrySubsystem = ...;
SentrySubsystem->ConfigureScope(ScopeDelegate);
```
<Note>
`ConfigureScope` function is supported only on macOS, iOS and Android.
</Note>
For Windows and Mac, configure all data on the global scope.
Alternatively, all data can be configured on the global scope using dedicated methods of `SentrySubsystem` class.
```cpp
USentrySubsystem* SentrySubsystem = ...;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<Note>

Local scopes are supported for iOS and Android only.

</Note>

```cpp
FConfigureScopeDelegate ScopeDelegate;
ScopeDelegate.BindDynamic(this, &USomeClass::HandleScopeDelegate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ The same result can be achieved by calling corresponding function in blueprint:
![Set context](unreal_set_context.png)
Alternatively, this configuration cab be provided to the crash reporter [during initialization](/platforms/unreal/setup-crashreporter/#configure-attributes).
Alternatively, this configuration can be provided to the crash reporter [during initialization](/platforms/unreal/configuration/setup-crashreporter/#configure-attributes).
2 changes: 1 addition & 1 deletion src/platform-includes/enriching-events/set-tag/unreal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The same result can be achieved by calling corresponding function in blueprint:
![Set tag](unreal_set_tag.png)
Alternatively, this configuration cab be provided to the crash reporter [during initialization](/platforms/unreal/setup-crashreporter/#configure-attributes).
Alternatively, this configuration can be provided to the crash reporter [during initialization](/platforms/unreal/configuration/setup-crashreporter/#configure-attributes).
Commonly used values including `Engine version`, `Configuration`, and `Target Type`, can be promoted to tags via Sentry's configuration window by navigating to the editor's menu **Project Settings > Plugins > Sentry > Misc > Promote values to tags** and selecting the values that should be automatically added to captured events as tags.
Expand Down
2 changes: 1 addition & 1 deletion src/platform-includes/enriching-events/set-user/unreal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ The same result can be achieved by calling corresponding function in blueprint:
![Set user](unreal_set_user.png)
Alternatively, this configuration cab be provided to the crash reporter [during initialization](/platforms/unreal/setup-crashreporter/#configure-attributes).
Alternatively, this configuration can be provided to the crash reporter [during initialization](/platforms/unreal/configuration/setup-crashreporter/#configure-attributes).
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Or in blueprint:

![Unset user](unreal_unset_user.png)

In configurations with a crash reporter, create a new `__sentry` config object without the `user` field. Then, call `FGenericCrashContext::SetGameData` from the [initialization function](/platforms/unreal/setup-crashreporter/#configure-attributes) with the new JSON data. You have to provide all other fields again, as the call overrides the previously registered data.
In configurations with a crash reporter, create a new `__sentry` config object without the `user` field. Then, call `FGenericCrashContext::SetGameData` from the [initialization function](/platforms/unreal/configuration/setup-crashreporter/#configure-attributes) with the new JSON data. You have to provide all other fields again, as the call overrides the previously registered data.
2 changes: 1 addition & 1 deletion src/platform-includes/getting-started-config/unreal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ The window can be accessed by going to editor's menu: **Project Settings > Plugi

![Sentry settings window](unreal_window.png)

Alternatively, the `Initialize SDK automatically` option can be enabled in order to initialize the SDK on application startup. In this case, explicit SDK initialization won't be required.
By default, the SDK is automatically initialized on application startup. Alternatively, the `Initialize SDK automatically` option can be disabled and in this case, explicit SDK initialization is required.

To override SDK settings at runtime, use the `InitializeWithSettings` method of the `SentrySubsystem` class.
2 changes: 1 addition & 1 deletion src/platform-includes/getting-started-install/unreal.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The Unreal Engine (UE) SDK is currently compatible with **UE 4.27 or later** and supports **Windows**, **Linux**, **macOS**, **iOS**, and **Android**.
The Unreal Engine (UE) SDK is officially supported for the three latest UE versions. However, it is likely to be compatible with older engine versions as well depending on the specific features and functionality that you need.

To build the SDK, download the latest sources from the [Releases page](https://github.com/getsentry/sentry-unreal/releases) and place it in the project's `Plugins` directory. On the next project launch, UE will prompt to build Sentry module.

Expand Down
16 changes: 5 additions & 11 deletions src/platform-includes/getting-started-primer/unreal.mdx
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
Configure Sentry with Unreal Engine.

<Alert level="warning" title="Warning">

This SDK is a preview that packages Sentry's native SDKs into an Unreal Engine plugin. Alternatively, the stable Crash Reporter tool provided by Epic Games can be used in order to capture and alert of errors from your game.

</Alert>
Unreal Engine SDK builds on top of other Sentry SDKs and extends them with Unreal Engine specific features. It gives developers helpful hints for where and why an error or performance issue might have occurred.

**Features:**

- Native support for automatic crash error tracking for
- Android by using the [Android SDK](/platforms/android/) to support Java, Kotlin, C and C++
- iOS by using the [iOS SDK](/platforms/apple/guides/ios/) to support Objective-C, Swift, C and C++
- Windows and Linux by using the [Native SDK](/platforms/native/) to support C and C++ with minidumps
- Windows (UE 5.2+) and Linux by using the [Native SDK](/platforms/native/) to support C and C++ with minidumps
- macOS by using the [macOS SDK](/platforms/apple/guides/macos/) to support Objective-C, Swift, C and C++
- Compatible with Unreal Engine 5
- [Crash Reporter Client](/platforms/unreal/setup-crashreporter/) provided along with Unreal Engine
- Compatible with [Crash Reporter Client](/platforms/unreal/configuration/setup-crashreporter/) provided along with Unreal Engine
- [Release health](/platforms/unreal/configuration/releases/) to keep track of crash free users and sessions

<Alert level="warning">

[Crash Reporter Client](/platforms/unreal/setup-crashreporter/) has to be configured in order to capture crashes on Windows automatically. This step isn't required starting with UE 5.2 because the engine provides an API, which allows you to switch between default and third-party crash-handling solutions.
[Crash Reporter Client](/platforms/unreal/configuration/setup-crashreporter/) has to be configured in order to capture crashes on Windows automatically with UE 5.1 or older. Starting from UE 5.2, the provided API allows you to switch between default and third-party crash-handling solutions, so this step isn't required.

</Alert>
17 changes: 17 additions & 0 deletions src/platform-includes/set-environment/unreal.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```cpp
FConfigureSettingsDelegate SettingsDelegate;
SettingsDelegate.BindDynamic(this, &USomeClass::HandleSettingsDelegate);

void USomeClass::HandleSettingsDelegate(USentrySettings* Settings)
{
Settings->Environment = FString(TEXT("MyEnvironment"));
}

...

USentrySubsystem* SentrySubsystem = ...;

SentrySubsystem->InitializeWithSettings(SettingsDelegate);
```
By default, the SDK reports `Editor` when running inside the Unreal Engine Editor. You can also set the default environment to `Release`, `Development`, or `Debug` in your build configuration or override the environment value manually.
21 changes: 16 additions & 5 deletions src/platform-includes/set-release/unreal.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
To configure Unreal to send release information, set the release [during
initialization](/platforms/unreal/setup-crashreporter/#configure-attributes):

```cpp
TSharedPtr<FJsonObject> config = MakeShareable(new FJsonObject);
config->SetStringField("release", "my-project-name@2.3.12");
FConfigureSettingsDelegate SettingsDelegate;
SettingsDelegate.BindDynamic(this, &USomeClass::HandleSettingsDelegate);

void USomeClass::HandleSettingsDelegate(USentrySettings* Settings)
{
Settings->OverrideReleaseName = true;
Settings->Release = FString(TEXT("MyRelease"));
}

...

USentrySubsystem* SentrySubsystem = ...;

SentrySubsystem->InitializeWithSettings(SettingsDelegate);
```
By default, the SDK will call `FApp::GetProjectName()` and read the `ProjectVersion` value from `DefaultGame.ini` to create the release in the format `$"{ProjectName}@{ProjectVersion}"`. It's possible to override the release name manually.
1 change: 1 addition & 0 deletions src/platforms/common/configuration/draining.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ notSupported:
- unity
- php
- elixir
- unreal
---

The default behavior of most SDKs is to send out events over the network
Expand Down
6 changes: 3 additions & 3 deletions src/platforms/common/configuration/filtering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ All Sentry SDKs support the <PlatformIdentifier name="before-send" /> callback m

Note also that breadcrumbs can be filtered, as discussed in [our Breadcrumbs documentation](/product/error-monitoring/breadcrumbs/).

<PlatformSection notSupported={["apple", "dotnet", "elixir", "rust"]}>
<PlatformSection notSupported={["apple", "dotnet", "elixir", "rust", "unreal"]}>

#### Event Hints

Expand All @@ -38,7 +38,7 @@ When the SDK creates an event or breadcrumb for transmission, that transmission

</PlatformSection>

<PlatformSection notSupported={["native", "apple", "dotnet"]}>
<PlatformSection notSupported={["native", "apple", "dotnet", "unreal"]}>

### Using Hints

Expand Down Expand Up @@ -92,7 +92,7 @@ You can use the <PlatformIdentifier name="ignore-errors" /> option to filter out

</PlatformSection>

<PlatformSection supported={["node", "javascript", "python", "php", "dotnet", "java", "ruby", "go", "react-native", "android", "dart"]} notSupported={["javascript.cordova"]}>
<PlatformSection supported={["node", "javascript", "python", "php", "dotnet", "java", "ruby", "go", "react-native", "android", "dart"]} notSupported={["javascript.cordova", "unreal"]}>

## Filtering Transaction Events

Expand Down
1 change: 0 additions & 1 deletion src/platforms/common/configuration/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ notSupported:
"native.wasm",
"perl",
"kotlin",
"unreal",
]
description: "Additional configuration options for the SDK."
sidebar_order: 5
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/common/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ This function is called with a backend-specific event object, and can return a m
</ConfigKey>
<ConfigKey name="before-breadcrumb" notSupported={["native"]}>
<ConfigKey name="before-breadcrumb" notSupported={["native", "unreal"]}>
This function is called with an SDK-specific breadcrumb object before the breadcrumb is added to the scope. When nothing is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object.
The callback typically gets a second argument (called a "hint") which contains the original object from which the breadcrumb was created to further customize what the breadcrumb should look like.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Upload Debug Symbols
title: Debug Symbols Uploading
description: "Learn how the Unreal Engine SDK handles debug symbols upload."
---

Expand All @@ -13,7 +13,7 @@ For Android, debug symbols upload is handled by [Sentry Android Gradle Plugin](/

The automated debug symbols upload is disabled by default and requires configuration. To configure it, navigate to **Project Settings > Plugins > Sentry**, then enter the [Auth Token](https://sentry.io/api/), Organization Slug, and Project Name. Note, that the Unreal Engine SDK automatically creates a `sentry.properties` file at the root of your project directory to store the configuration. This configuration file should **never** be made publicly available.

![The UE4 debug symbols ppload configuration](unreal-debug-symbols.png)
![The Unreal Engine debug symbols upload configuration](unreal-debug-symbols.png)

### Manual Upload Using sentry-cli

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: Setup Crash Reporter Client
description: "Learn about Sentry's integration with Unreal Engine 4 (UE4)."
title: Crash Reporter Client
description: "Learn about Sentry's Unreal Engine integration with Crash Reporter Client."
redirect_from:
- /platforms/unreal/setup-crashreport/
- /platforms/unreal/setup-crashreporter/
---

Installation of a Sentry SDK is not required in order to capture the crashes of your
Expand Down
4 changes: 2 additions & 2 deletions src/wizard/unreal/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ ___PUBLIC_DSN___

## Crash Reporter Client

For Windows and Mac, [Crash Reporter Client](/platforms/unreal/setup-crashreporter/) provided along with Unreal Engine has to be configured in order to capture errors automatically.
For Windows and Mac, [Crash Reporter Client](/platforms/unreal/configuration/setup-crashreporter/) provided along with Unreal Engine has to be configured in order to capture errors automatically.

### Include the UE4 Crash Reporter
### Include the Unreal Engine Crash Reporter

You can add the crash reporter client to your game in **Project Settings**.

Expand Down

1 comment on commit 728eae3

@vercel
Copy link

@vercel vercel bot commented on 728eae3 Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sentry-docs – ./

docs.sentry.io
sentry-docs.sentry.dev
sentry-docs-git-master.sentry.dev

Please sign in to comment.