You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9cbecbb
Browse filesBrowse the repository at this point in the historyBrowse files
docs(unreal): Document trace level and ESentryLogLevel for structured logs (#20915)
## DESCRIBE YOUR PR
The Unreal SDK adds a separate `ESentryLogLevel` enum for structured
logs. It includes the `Trace` level, which `ESentryLevel` can't express
because events, breadcrumbs, and scopes have no such level. This is a
breaking change in v2.0.0.
Updates the logs and migration pages:
- Adds a "Migrating to 2.0.0" section to the migration guide. It
explains the switch from `ESentryLevel` to `ESentryLogLevel` for
`USentryLog`, and that `VeryVerbose` `UE_LOG` messages are now sent as
`trace` logs controlled by the new `bOnTraceLog` option. It also states
that the new option is disabled by default, so projects that forward
`Verbose` messages have to enable it to forward `VeryVerbose` messages.
- Adds `LogTrace()` and `LogTraceWithAttributes()` to the usage page and
a `UE_LOG` example for `VeryVerbose` messages.
- Adds a table that maps `UE_LOG` verbosity to settings and log severity
on the setup page, and updates the before-log handler example and the
`USentryLog` method list to use `ESentryLogLevel`.
- Updates the level rows in the options table to match the setting names
in the plugin settings, and adds the new `VeryVerbose` option.
- Changes the best practices examples to use the public `LogInfo()`,
`LogWarning()`, and `LogDebug()` methods. They used `AddLog()` with
`ESentryLevel`, which isn't part of the public API.
Not ready to merge until getsentry/sentry-unreal#1715 is released in
Unreal SDK v2.0.0.
## Related Items
- getsentry/sentry-unreal#1715
- getsentry/sentry-unreal#1625
## IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs
to go live.
Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the
due date. You can update this information later by editing the PR
description.
- [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD
- [ ] Other deadline: YYYY-MM-DD
- [x] No deadline: Not urgent, can wait up to 1 week+
## SLA
- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
supplied a deadline.
Thanks in advance for your help!
## PRE-MERGE CHECKLIST
_Make sure you've checked the following before merging your changes:_
- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)
Copy file name to clipboardExpand all lines: docs/platforms/unreal/migration/index.mdx
+60Lines changed: 60 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,34 @@ We recommend using this guide starting from the version closes to your current v
13
13
14
14
### Breaking changes
15
15
16
+
#### Crash Backend Selection
17
+
18
+
The `UseNativeBackend` option is replaced by the `CrashBackend` option (**Project Settings > Plugins > Sentry > Crash Handling > Crash backend**), and the native backend is now the default on Windows, Linux, and Xbox. `CrashBackend` accepts the following values:
The SDK no longer reads `UseNativeBackend`. If your project configuration file sets it, replace it with `CrashBackend`:
27
+
28
+
```ini
29
+
; Enabling the native backend before v2.0.0
30
+
31
+
[/Script/Sentry.SentrySettings]
32
+
UseNativeBackend=True
33
+
34
+
; Enabling the native backend in v2.0.0 (also on macOS)
35
+
36
+
[/Script/Sentry.SentrySettings]
37
+
CrashBackend=Native
38
+
```
39
+
40
+
If you want to keep using Crashpad on Windows and Linux or Breakpad on Xbox, set `CrashBackend=Legacy`.
41
+
42
+
The backend is selected at build time, so rebuild your project after changing this option.
43
+
16
44
#### Assert Handling
17
45
18
46
`FSentryOutputDevice` and `FSentryErrorOutputDevice` are no longer part of the public API. If you subscribed to the `OnAssert` delegate of `FSentryErrorOutputDevice`, use the static `FSentryDelegates::OnAssert` delegate instead:
The delegate is called on the thread that hit the assertion, before the crash is reported. Your handler must be thread-safe and must not access UObjects.
42
70
71
+
#### Structured Logs Level
72
+
73
+
Structured logs now use the new `ESentryLogLevel` enum instead of `ESentryLevel`. It adds the `Trace` level, which the logs protocol supports but events, breadcrumbs, and scopes don't. Events, breadcrumbs, and scopes still use `ESentryLevel`.
74
+
75
+
If you set or read the level of a `USentryLog` (for example, in a custom `USentryBeforeLogHandler`), update your code to use `ESentryLogLevel`:
76
+
77
+
```cpp
78
+
// Filtering logs by level before v2.0.0
79
+
80
+
if (LogData->GetLevel() == ESentryLevel::Debug)
81
+
{
82
+
return nullptr;
83
+
}
84
+
85
+
// Filtering logs by level in v2.0.0
86
+
87
+
if (LogData->GetLevel() == ESentryLogLevel::Debug || LogData->GetLevel() == ESentryLogLevel::Trace)
88
+
{
89
+
return nullptr;
90
+
}
91
+
```
92
+
93
+
If you use Blueprints, recreate the **Set Level** and **Get Level** nodes of `Sentry Log` objects and the nodes connected to them.
94
+
95
+
#### Unreal Engine Log Forwarding
96
+
97
+
`UE_LOG` messages with `VeryVerbose` verbosity are now sent as `trace` structured logs instead of `debug` ones. The `Verbose/VeryVerbose` option in the plugin settings (`StructuredLoggingLevels.bOnDebugLog`) is split into the `Verbose` (`bOnDebugLog`) and `VeryVerbose` (`bOnTraceLog`) options.
98
+
99
+
The `VeryVerbose` option is disabled by default. If your project forwards `Verbose` messages and you also want to forward `VeryVerbose` messages, enable `bOnTraceLog`.
100
+
101
+
Breadcrumbs for `VeryVerbose` messages still use the `Debug` level.
The `HandleBeforeLog_Implementation` method receives a `USentryLog` object, and should return the log event if you want it to be sent to Sentry, or `nullptr` if you want to discard it.
112
125
113
126
The `USentryLog` object has the following methods:
114
-
- `GetLevel()`: Returns the severity level of the log (`ESentryLevel`)
127
+
- `GetLevel()`: Returns the severity level of the log (`ESentryLogLevel`)
115
128
- `GetBody()`: Returns the formatted log message (`FString`)
116
-
- `SetLevel(ESentryLevelLevel)`: Sets the Level of the Log Event
129
+
- `SetLevel(ESentryLogLevelLevel)`: Sets the Level of the Log Event
117
130
- `SetBody(FString&Body)`: Sets the Body of the Log Event
118
131
- `SetAttribute(Key, Value)`: Sets a custom attribute on the log
0 commit comments