Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add diagnostic level setting for symbol upload #555

Merged
merged 5 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Features

- Add diagnostic level setting for symbol upload ([#555](https://github.com/getsentry/sentry-unreal/pull/555))
tustanivsky marked this conversation as resolved.
Show resolved Hide resolved

## 0.17.1

### Fixes
Expand Down
9 changes: 8 additions & 1 deletion plugin-dev/Scripts/upload-debug-symbols-win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ if /i "%IncludeSourceFiles%"=="True" (
set "CliArgs=--include-sources"
)

set CliLogLevel=

call :ParseIniFile "%ConfigPath%\DefaultEngine.ini" /Script/Sentry.SentrySettings DiagnosticLevel CliLogLevel
if "%CliLogLevel%"=="" (
set "CliLogLevel=info"
)

call :ParseIniFile "%ConfigPath%\DefaultEngine.ini" /Script/Sentry.SentrySettings EnableBuildPlatforms EnabledPlatforms
if not "%EnabledPlatforms%"=="" (
set PlatformToCheck=
Expand Down Expand Up @@ -99,7 +106,7 @@ echo Sentry: Upload started using PropertiesFile '%PropertiesFile%'
set "SENTRY_PROPERTIES=%PropertiesFile%"
echo %ProjectBinariesPath%
echo %PluginBinariesPath%
call "%CliExec%" upload-dif %CliArgs% --log-level info "%ProjectBinariesPath%" "%PluginBinariesPath%"
call "%CliExec%" upload-dif %CliArgs% --log-level %CliLogLevel% "%ProjectBinariesPath%" "%PluginBinariesPath%"

echo Sentry: Upload finished

Expand Down
8 changes: 7 additions & 1 deletion plugin-dev/Scripts/upload-debug-symbols.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ if [ -z $INCLUDE_SOURCES -a $UPLOAD_SYMBOLS == "True" ]; then
CLI_ARGS+=(--include-sources)
fi

CLI_LOG_LEVEL=$(awk -F "=" '/DiagnosticLevel/ {print $2}' ${CONFIG_PATH}/DefaultEngine.ini)

if [ -z $CLI_LOG_LEVEL ]; then
CLI_LOG_LEVEL="info"
fi

ENABLED_PLATFORMS=$(grep "EnableBuildPlatforms" ${CONFIG_PATH}/DefaultEngine.ini | sed -n 's/^EnableBuildPlatforms=//p' | sed -e 's/^(\(.*\))$/\1/')
if [ ! -z $ENABLED_PLATFORMS ]; then
PLATFORMS_ARRAY=$(echo "$ENABLED_PLATFORMS" | sed -e 's/,/ /g')
Expand Down Expand Up @@ -91,6 +97,6 @@ echo "Sentry: Upload started using PropertiesFile '$SENTRY_PROPERTIES'"

chmod +x $SENTRY_CLI_EXEC

$SENTRY_CLI_EXEC upload-dif $CLI_ARGS[@] $PROJECT_BINARIES_PATH $PLUGIN_BINARIES_PATH
$SENTRY_CLI_EXEC upload-dif $CLI_ARGS[@] --log-level $CLI_LOG_LEVEL $PROJECT_BINARIES_PATH $PLUGIN_BINARIES_PATH

echo "Sentry: Upload finished"
4 changes: 3 additions & 1 deletion plugin-dev/Source/Sentry/Private/SentrySettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ USentrySettings::USentrySettings(const FObjectInitializer& ObjectInitializer)
, TracesSampleRate(0.0f)
, TracesSampler(USentryTraceSampler::StaticClass())
, EnableForPromotedBuildsOnly(false)
, UploadSymbolsAutomatically(false)
, UploadSymbolsAutomatically(false)
, IncludeSources(false)
, DiagnosticLevel(ESentryCliLogLevel::Info)
, CrashReporterUrl()
, bIsDirty(false)
{
Expand Down Expand Up @@ -63,6 +64,7 @@ void USentrySettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChan
PropertyChangedEvent.Property->GetFName() == GET_MEMBER_NAME_CHECKED(USentrySettings, OrgName) ||
PropertyChangedEvent.Property->GetFName() == GET_MEMBER_NAME_CHECKED(USentrySettings, AuthToken) ||
PropertyChangedEvent.Property->GetFName() == GET_MEMBER_NAME_CHECKED(USentrySettings, IncludeSources) ||
PropertyChangedEvent.Property->GetFName() == GET_MEMBER_NAME_CHECKED(USentrySettings, DiagnosticLevel) ||
PropertyChangedEvent.Property->GetFName() == GET_MEMBER_NAME_CHECKED(USentrySettings, CrashReporterUrl))
{
return;
Expand Down
14 changes: 14 additions & 0 deletions plugin-dev/Source/Sentry/Public/SentrySettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ enum class ESentryTracesSamplingType : uint8
TracesSampler
};

UENUM(BlueprintType)
enum class ESentryCliLogLevel : uint8
{
Trace,
Debug,
Info,
Warn,
Error
};

USTRUCT(BlueprintType)
struct FAutomaticBreadcrumbs
{
Expand Down Expand Up @@ -333,6 +343,10 @@ class SENTRY_API USentrySettings : public UObject
Meta = (DisplayName = "Upload sources", ToolTip = "Flag indicating whether to automatically scan the debug files for references to source code files and upload them if any.", EditCondition = "UploadSymbolsAutomatically"))
bool IncludeSources;

UPROPERTY(Config, EditAnywhere, Category = "Debug Symbols",
Meta = (DisplayName = "Diagnostic Level", ToolTip = "Logs verbosity level during symbol uploading.", EditCondition = "UploadSymbolsAutomatically"))
ESentryCliLogLevel DiagnosticLevel;

UPROPERTY(Config, EditAnywhere, Category = "Crash Reporter",
Meta = (DisplayName = "Crash Reporter Endpoint", ToolTip = "Endpoint that Unreal Engine Crah Reporter should use in order to upload crash data to Sentry."))
FString CrashReporterUrl;
Expand Down
Loading