Skip to content

Commit 5f967fb

Browse files
tustanivskyimatwawanaGloryOfNightSergey Dikiy
authored
Top level Unreal Engine and plugin (#4977)
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> Co-authored-by: Sergey Dikiy <siarhei.dziki@gmail.com> Co-authored-by: Sergey Dikiy <steampro97@gmail.com>
1 parent b0da650 commit 5f967fb

File tree

55 files changed

+411
-114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+411
-114
lines changed

src/docs/contributing/approach/sdk-docs/write-data-management.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This file is `/sensitive-data/index.mdx`. It explains how to scrub or filter dat
3030

3131
For data scrubbing that the SDK DOES NOT support, add the name of the SDK to the `PlatformSection notSupported` statement, which ensures the content won't display. For example:
3232

33-
`<PlatformSection notSupported={["flutter", "apple", "perl", "native.breakpad", "native.crashpad", "native.minidumps", "native.wasm", "native.ue4", "go", "ruby", "native", "elixir"]}>`
33+
`<PlatformSection notSupported={["flutter", "apple", "perl", "native.breakpad", "native.crashpad", "native.minidumps", "native.wasm", "unreal", "go", "ruby", "native", "elixir"]}>`
3434

3535
Add the code sample to these directories:
3636

src/docs/contributing/platforms/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ If you wanted to make hide the content for a platform by default, but enable it
110110

111111
```markdown
112112
---
113-
supported:
114-
- native.ue4
113+
supported:
114+
- native.wasm
115115
notSupported:
116116
- native
117117
---
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
To simplify creating events, there are shorthand functions that construct prepopulated event objects. The most important one is `CaptureMessage`. The `Level` parameter is optional:
2+
3+
```cpp
4+
USentrySubsystem* SentrySubsystem = ...;
5+
6+
SentrySubsystem->CaptureMessage("Message", ESentryLevel::Info);
7+
```
8+
9+
There is also the option to configure scope for some specific messages:
10+
11+
```cpp
12+
USentrySubsystem* SentrySubsystem = ...;
13+
14+
FConfigureScopeDelegate ScopeDelegate;
15+
ScopeDelegate.BindDynamic(this, &USomeClass::HandleScopeDelegate);
16+
17+
SentrySubsystem->CaptureMessageWithScope("Message", ScopeDelegate, ESentryLevel::Info);
18+
19+
// Put scope configuration logic here
20+
void USomeClass::HandleScopeDelegate(USentryScope* Scope)
21+
{
22+
Scope->SetTagValue("Module", "Test");
23+
...
24+
}
25+
```
26+
27+
The same result can be achieved by calling corresponding functions in blueprint:
28+
29+
![Capture message](unreal_capture_message.png)
30+
31+
32+
<Note>
33+
34+
Scoped message capturing is supported only on iOS and Android.
35+
36+
</Note>
37+
38+
## Manual Events
39+
40+
To create and capture a manual event:
41+
42+
1. Create an event, `USentryEvent`. This internally creates an object and initializes it with common event attributes, like `timestamp` and `event_id`.
43+
2. Set custom attributes of the event, like `Message` or `Level`.
44+
3. Send the event to Sentry by invoking the `CaptureEvent` method `USentrySubsystem`.
45+
46+
In a simplest case, it looks like this:
47+
48+
```c
49+
USentrySubsystem* SentrySubsystem = ...;
50+
51+
USentryEvent* Event = NewObject<USentryEvent>();
52+
Event->SetMessage("Message");
53+
Event->SetLevel(ESentryLevel::Info);
54+
55+
SentrySubsystem->CaptureEvent(Event);
56+
```
57+
58+
You can also configure scope for some specific events:
59+
60+
```cpp
61+
USentrySubsystem* SentrySubsystem = ...;
62+
63+
USentryEvent* Event = NewObject<USentryEvent>();
64+
Event->SetMessage("Message");
65+
Event->SetLevel(ESentryLevel::Info);
66+
67+
FConfigureScopeDelegate ScopeDelegate;
68+
ScopeDelegate.BindDynamic(this, &USomeClass::HandleScopeDelegate);
69+
70+
SentrySubsystem->CaptureEventWithScope(Event, ScopeDelegate, ESentryLevel::Info);
71+
72+
// Put scope configuration logic here
73+
void USomeClass::HandleScopeDelegate(USentryScope* Scope)
74+
{
75+
Scope->SetTagValue("Module", "Test");
76+
...
77+
}
78+
```
79+
80+
The same result can be achieved by calling corresponding functions in blueprint:
81+
82+
![Capture event](unreal_capture_event.png)
83+
84+
<Note>
85+
86+
Scoped events capturing is supported only on iOS and Android platforms.
87+
88+
</Note>
89+
90+
For the full list of supported values, check out [_Event Payloads_](https://develop.sentry.dev/sdk/event-payloads/) and linked documents.
Loading
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
```cpp
2+
USentrySubsystem* SentrySubsystem = ...;
3+
4+
TMap<FString, FString> AdditionalData;
5+
AdditionalData.Add("SomeKey", "SomeValue");
6+
7+
SentrySubsystem->AddBreadcrumb("Message", "Category", "Type", AdditionalData, ESentryLevel::Info);
8+
```
9+
10+
The same result can be achieved by calling corresponding function in blueprint:
11+
12+
![Add breadcrumb](ureal_breadcrumb.png)
Loading

src/includes/enriching-events/set-context/native.ue4.mdx

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
```cpp
2+
USentrySubsystem* SentrySubsystem = ...;
3+
4+
TMap<FString, FString> ContextData;
5+
AdditionalData.Add("Class", "Paladin");
6+
AdditionalData.Add("Role", "Taunt");
7+
8+
SentrySubsystem->SetContext("Character", ContextData);
9+
```
10+
11+
The same result can be achieved by calling corresponding function in blueprint:
12+
13+
![Set context](unreal_set_context.png)
14+
15+
Alternatively, this configuration cab be provided to the crash reporter [during initialization](/platforms/unreal/setup-crashreport/#configure-attributes).
Loading

0 commit comments

Comments
 (0)