Skip to content

Commit

Permalink
removed native override
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsandfoxes committed Nov 7, 2024
1 parent 65fca3d commit 3c7e7b1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 59 deletions.
18 changes: 9 additions & 9 deletions src/Sentry.Unity.Editor.iOS/NativeIOSOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ internal static string Generate(SentryUnityOptions options)
[PrivateSentrySDKOnly setSdkName:@""sentry.cocoa.unity""];
NSDictionary* optionsDictionary = @{{
@""dsn"" : @""{options.NativeOverrides.Dsn ?? options.Dsn}"",
@""debug"" : @{ToObjCString(options.NativeOverrides.Debug ?? options.Debug)},
@""diagnosticLevel"" : @""{ToNativeDiagnosticLevel(options.NativeOverrides.DiagnosticLevel ?? options.DiagnosticLevel)}"",
@""maxBreadcrumbs"": @{options.NativeOverrides.MaxBreadcrumb ?? options.MaxBreadcrumbs},
@""maxCacheItems"": @{options.NativeOverrides.MaxCacheItem ?? options.MaxCacheItems},
@""dsn"" : @""{options.Dsn}"",
@""debug"" : @{ToObjCString(options.Debug)},
@""diagnosticLevel"" : @""{ToNativeDiagnosticLevel(options.DiagnosticLevel)}"",
@""maxBreadcrumbs"": @{options.MaxBreadcrumbs},
@""maxCacheItems"": @{options.MaxCacheItems},
@""enableAutoSessionTracking"": @NO,
@""enableAppHangTracking"": @NO,
@""enableCaptureFailedRequests"": @{ToObjCString(options.CaptureFailedRequests)},
@""failedRequestStatusCodes"" : @[{failedRequestStatusCodesArray}],
@""sendDefaultPii"" : @{ToObjCString(options.NativeOverrides.SendDefaultPii ?? options.SendDefaultPii)},
@""attachScreenshot"" : @{ToObjCString(options.NativeOverrides.AttachScreenshot ?? options.AttachScreenshot)},
@""release"" : @""{options.NativeOverrides.Release ?? options.Release}"",
@""environment"" : @""{options.NativeOverrides.Environment ?? options.Environment}"",
@""sendDefaultPii"" : @{ToObjCString(options.SendDefaultPii)},
@""attachScreenshot"" : @{ToObjCString(options.AttachScreenshot)},
@""release"" : @""{options.Release}"",
@""environment"" : @""{options.Environment}"",
@""enableNetworkBreadcrumbs"" : @NO
}};
Expand Down
33 changes: 14 additions & 19 deletions src/Sentry.Unity.Editor/Android/AndroidManifestConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,37 +135,32 @@ internal void ModifyManifest(string basePath)
_logger.LogDebug("Setting DSN: {0}", _options!.Dsn);
androidManifest.SetDsn(_options.Dsn!);

var debug = _options.NativeOverrides.Debug ?? _options.Debug;
if (debug)
if (_options.Debug)
{
_logger.LogDebug("Setting Debug: {0}", debug);
androidManifest.SetDebug(debug);
_logger.LogDebug("Setting Debug: {0}", _options.Debug);
androidManifest.SetDebug(_options.Debug);
}

var release = _options.NativeOverrides.Release ?? _options.Release;
if (release is not null)
if (_options.Release is not null)
{
_logger.LogDebug("Setting Release: {0}", release);
androidManifest.SetRelease(release);
_logger.LogDebug("Setting Release: {0}", _options.Release);
androidManifest.SetRelease(_options.Release);
}

var environment = _options.NativeOverrides.Environment ?? _options.Environment;
if (environment is not null)
if (_options.Environment is not null)
{
_logger.LogDebug("Setting Environment: {0}", environment);
androidManifest.SetEnvironment(environment);
_logger.LogDebug("Setting Environment: {0}", _options.Environment);
androidManifest.SetEnvironment(_options.Environment);
}

var diagnosticLevel = _options.NativeOverrides.DiagnosticLevel ?? _options.DiagnosticLevel;
_logger.LogDebug("Setting DiagnosticLevel: {0}", diagnosticLevel);
androidManifest.SetLevel(diagnosticLevel);
_logger.LogDebug("Setting DiagnosticLevel: {0}", _options.DiagnosticLevel);
androidManifest.SetLevel(_options.DiagnosticLevel);

var sampleRate = _options.NativeOverrides.SampleRate ?? _options.SampleRate;
if (sampleRate.HasValue)
if (_options.SampleRate.HasValue)
{
// To keep the logs in line with what the SDK writes to the AndroidManifest we're formatting here too
_logger.LogDebug("Setting SampleRate: {0}", ((float)sampleRate).ToString("F", CultureInfo.InvariantCulture));
androidManifest.SetSampleRate(sampleRate.Value);
_logger.LogDebug("Setting SampleRate: {0}", ((float)_options.SampleRate).ToString("F", CultureInfo.InvariantCulture));
androidManifest.SetSampleRate(_options.SampleRate.Value);
}

// TODO: Missing on AndroidManifest
Expand Down
30 changes: 0 additions & 30 deletions src/Sentry.Unity/NativeOptions.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Sentry.Unity/SentryUnityOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Sentry.Unity;
/// <remarks>
/// Options to configure Unity while extending the Sentry .NET SDK functionality.
/// </remarks>
public sealed partial class SentryUnityOptions : SentryOptions
public sealed class SentryUnityOptions : SentryOptions
{
/// <summary>
/// UPM name of Sentry Unity SDK (package.json)
Expand Down

0 comments on commit 3c7e7b1

Please sign in to comment.