Skip to content

Commit

Permalink
UE plugin documentation update (#8653)
Browse files Browse the repository at this point in the history
  • Loading branch information
tustanivsky authored Dec 7, 2023
1 parent 5b25bfe commit 4d18a49
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 35 deletions.
8 changes: 4 additions & 4 deletions src/platform-includes/capture-message/unreal.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
To simplify creating events, there are shorthand functions that construct prepopulated event objects. The most important one is `CaptureMessage`. The `Level` parameter is optional:

```cpp
USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

SentrySubsystem->CaptureMessage("Message", ESentryLevel::Info);
```
There is also the option to configure scope for some specific messages:
```cpp
USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();
FConfigureScopeDelegate ScopeDelegate;
ScopeDelegate.BindDynamic(this, &USomeClass::HandleScopeDelegate);
Expand Down Expand Up @@ -45,7 +45,7 @@ To create and capture a manual event:
In a simplest case, it looks like this:

```c
USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

USentryEvent* Event = NewObject<USentryEvent>();
Event->SetMessage("Message");
Expand All @@ -57,7 +57,7 @@ SentrySubsystem->CaptureEvent(Event);
You can also configure scope for some specific events:
```cpp
USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();
USentryEvent* Event = NewObject<USentryEvent>();
Event->SetMessage("Message");
Expand Down
2 changes: 1 addition & 1 deletion src/platform-includes/configuration/before-send/unreal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void USomeClass::HandleSettingsDelegate(USentrySettings* Settings)

...

USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

SentrySubsystem->InitializeWithSettings(SettingsDelegate);
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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.
The UE layer self-initializes through the use of the custom [UEngineSubsystem](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Engine/Subsystems/UEngineSubsystem/).

<Note>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```cpp
USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

FConfigureScopeDelegate ScopeDelegate;
ScopeDelegate.BindDynamic(this, &USomeClass::HandleScopeDelegate);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```cpp
USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

TMap<FString, FString> AdditionalData;
AdditionalData.Add("SomeKey", "SomeValue");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ void USomeClass::HandleScopeDelegate(USentryScope* Scope)

...

USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

SentrySubsystem->ConfigureScope(ScopeDelegate);
```
Alternatively, all data can be configured on the global scope using dedicated methods of `SentrySubsystem` class.
```cpp
USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();
USentryUser* SentryUser = NewObject<USentryUser>();
SentryUser->SetEmail("[email protected]");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void USomeClass::HandleScopeDelegate(USentryScope* Scope)

...

USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

// will be tagged with my-tag="my value"
SentrySubsystem->CaptureMessageWithScope("Error message", ScopeDelegate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void USomeClass::HandleScopeDelegate(USentryScope* Scope)

...

USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

// will be tagged with my-tag="my value"
SentrySubsystem->CaptureMessageWithScope("Error message", ScopeDelegate);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```cpp
USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

TMap<FString, FString> ContextData;
AdditionalData.Add("Class", "Paladin");
Expand Down
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
@@ -1,5 +1,5 @@
```cpp
USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

SentrySubsystem->SetTag("tag1", "value1");
```
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
@@ -1,5 +1,5 @@
```cpp
USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

TMap<FString, FString> AdditionalData;
AdditionalData.Add("DogName", "Spot");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```cpp
USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

SentrySubsystem->RemoveUser();
```
Expand Down
Binary file modified src/platform-includes/getting-started-config/unreal_window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/platform-includes/getting-started-install/unreal.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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 install the SDK, download the most up-to-date sources from the [Releases page](https://github.com/getsentry/sentry-unreal/releases) and add them to your project's `Plugins` directory. On the next project launch, UE will prompt you to build the Sentry module.
To install the SDK, download the most up-to-date sources from the [Releases page](https://github.com/getsentry/sentry-unreal/releases) and add them to your project's `Plugins` directory. On the next project launch, UE will prompt you to build the Sentry and SentryEditor modules.

<Note>

Expand All @@ -12,11 +12,11 @@ Currently, this method is available only for C++ UE projects. Blueprint projects

The [Releases page](https://github.com/getsentry/sentry-unreal/releases) provides two plugin packages: `github` and `marketplace`. The key difference between the two is the crash capturing backend, which is used under the hood on Windows.

We recommend using the `github` version which uses `Crashpad`, an out-of-proc handler that sends the crash report right away. The `marketplace` version relies on `Breakpad`, an in-proc handler which requires the UE application or game to be relaunched in order to send the crash report to Sentry.
We recommend using the `github` version which uses `Crashpad`, an out-of-proc handler that sends the crash report right away. The `marketplace` version relies on `Breakpad`, an in-proc handler which requires the UE application or game to be relaunched in order to send the crash reports to Sentry.

</Note>

Alternatively, the Sentry SDK can be downloaded via the [standard installation process](https://docs.unrealengine.com/5.2/en-US/working-with-plugins-in-unreal-engine/#installingpluginsfromtheunrealenginemarketplace) from its UE Marketplace page within the Epic Games Launcher.
Alternatively, the Sentry SDK can be downloaded via the [standard installation process](https://docs.unrealengine.com/5.2/en-US/working-with-plugins-in-unreal-engine/#installingpluginsfromtheunrealenginemarketplace) from its [UE Marketplace](https://www.unrealengine.com/marketplace/en-US/product/sentry-01) page within the Epic Games Launcher.

<Note>

Expand Down
5 changes: 1 addition & 4 deletions src/platform-includes/getting-started-verify/unreal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ This snippet includes message capturing, so you can test that everything is work

void Verify()
{
// Obtain reference to GameInstance
UGameInstance* GameInstance = ...;

// Capture message
USentrySubsystem* SentrySubsystem = GameInstance->GetSubsystem<USentrySubsystem>();
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();
SentrySubsystem->CaptureMessage(TEXT("Capture message"));
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/platform-includes/set-environment/unreal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void USomeClass::HandleSettingsDelegate(USentrySettings* Settings)

...

USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

SentrySubsystem->InitializeWithSettings(SettingsDelegate);
```
Expand Down
2 changes: 1 addition & 1 deletion src/platform-includes/set-level/unreal.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```c
USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

SentrySubsystem->SetLevel(ESentryLevel::Info);
```
Expand Down
2 changes: 1 addition & 1 deletion src/platform-includes/set-release/unreal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void USomeClass::HandleSettingsDelegate(USentrySettings* Settings)

...

USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

SentrySubsystem->InitializeWithSettings(SettingsDelegate);
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
```cpp
USentrySubsystem* SentrySubsystem = ...;
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

USentryId* EventId = ...;
USentryId* EventId = SentrySubsystem->CaptureMessage(TEXT("Message with feedback"));

USentryUserFeedback* UserFeedback = NewObject<USentryUserFeedback>();
User->Initialize(EventId);
Expand Down
13 changes: 6 additions & 7 deletions src/wizard/unreal/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ type: framework

## Installation

Download the latest plugin 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.
Download the latest plugin sources from the [Releases page](https://github.com/getsentry/sentry-unreal/releases) and place it in the project's "Plugins" directory or install the plugin from the [UE Marketplace](https://www.unrealengine.com/marketplace/en-US/product/sentry-01) page via the Epic Games Launcher.

After the successful build, in the editor navigate to the **Project Settings > Plugins > Code Plugins** menu and check whether the Sentry plugin is enabled.
> The [Releases page](https://github.com/getsentry/sentry-unreal/releases) provides two plugin packages: `github` and `marketplace`. We recommend using the `github` version which uses `Crashpad`, an out-of-proc handler that sends the crash report right away. The `marketplace` version relies on `Breakpad`, an in-proc handler which requires the UE application or game to be relaunched in order to send the crash reports to Sentry.
In the editor navigate to the **Project Settings > Plugins > Code Plugins** menu and check whether the Sentry plugin is enabled.

To access the plugin API from within C++, add Sentry support to the build script (MyProject.build.cs):

Expand All @@ -42,7 +44,7 @@ ___PUBLIC_DSN___

## Crash Reporter Client

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.
In Unreal Engine versions prior to UE 5.2 to automatically capture errors on desktop platforms [Crash Reporter Client](/platforms/unreal/configuration/setup-crashreporter/) has to be configured.

### Include the Unreal Engine Crash Reporter

Expand Down Expand Up @@ -113,11 +115,8 @@ Once everything is configured you can call the plugin API from both C++ and blue

void Verify()
{
// Obtain reference to GameInstance
UGameInstance* GameInstance = ...;

// Capture message
USentrySubsystem* SentrySubsystem = GameInstance->GetSubsystem<USentrySubsystem>();
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();
SentrySubsystem->CaptureMessage(TEXT("Capture message"));
}
```

1 comment on commit 4d18a49

@vercel
Copy link

@vercel vercel bot commented on 4d18a49 Dec 7, 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 – ./

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

Please sign in to comment.