@@ -70,7 +70,6 @@ - (instancetype)init
7070{
7171 if (self = [super init ]) {
7272 self.enabled = YES ;
73- self.shutdownTimeInterval = 2.0 ;
7473 self.enableCrashHandler = YES ;
7574#if TARGET_OS_OSX
7675 self.enableUncaughtNSExceptionReporting = NO ;
@@ -81,16 +80,10 @@ - (instancetype)init
8180 self.diagnosticLevel = kSentryLevelDebug ;
8281 self.debug = NO ;
8382 self.maxBreadcrumbs = defaultMaxBreadcrumbs;
84- self.maxCacheItems = 30 ;
85- self.sampleRate = SENTRY_DEFAULT_SAMPLE_RATE;
8683 self.enableAutoSessionTracking = YES ;
8784 self.enableGraphQLOperationTracking = NO ;
8885 self.enableWatchdogTerminationTracking = YES ;
89- self.sessionTrackingIntervalMillis = [@30000 unsignedIntValue ];
9086 self.attachStacktrace = YES ;
91- // Maximum attachment size is 100 MiB, matches Relay's limit:
92- // https://develop.sentry.dev/sdk/data-model/envelopes/#size-limits
93- self.maxAttachmentSize = 100 * 1024 * 1024 ;
9487 self.sendDefaultPii = NO ;
9588 self.enableAutoPerformanceTracing = YES ;
9689 self.enablePersistingTracesWhenCrashing = NO ;
@@ -133,59 +126,6 @@ - (instancetype)init
133126 self.sendClientReports = YES ;
134127 self.swiftAsyncStacktraces = NO ;
135128 self.enableSpotlight = NO ;
136- self.spotlightUrl = @" http://localhost:8969/stream" ;
137-
138- #if TARGET_OS_OSX
139- NSString *dsn = [[[NSProcessInfo processInfo ] environment ] objectForKey: @" SENTRY_DSN" ];
140- if (dsn.length > 0 ) {
141- self.dsn = dsn;
142- }
143- #endif // TARGET_OS_OSX
144-
145- // Use the name of the bundle's executable file as inAppInclude, so SentryInAppLogic
146- // marks frames coming from there as inApp. With this approach, the SDK marks public
147- // frameworks such as UIKitCore, CoreFoundation, GraphicsServices, and so forth, as not
148- // inApp. For private frameworks, such as Sentry, dynamic and static frameworks differ.
149- // Suppose you use dynamic frameworks inside your app. In that case, the SDK marks these as
150- // not inApp as these frameworks are located in the application bundle, but their location
151- // is different from the main executable. In case you have a private framework that should
152- // be inApp you can add it to inAppInclude. When using static frameworks, the frameworks end
153- // up in the main executable. Therefore, the SDK currently can't detect if a frame of the
154- // main executable originates from the application or a private framework and marks all of
155- // them as inApp. To fix this, the user can use stack trace rules on Sentry.
156- NSDictionary *infoDict = [[NSBundle mainBundle ] infoDictionary ];
157- NSString *bundleExecutable = infoDict[@" CFBundleExecutable" ];
158- if (bundleExecutable == nil ) {
159- _inAppIncludes = [NSArray new ];
160- } else {
161- _inAppIncludes = @[ bundleExecutable ];
162- }
163-
164- _inAppExcludes = [NSArray new ];
165-
166- // Set default release name
167- if (infoDict != nil ) {
168- self.releaseName =
169- [NSString stringWithFormat: @" %@ @%@ +%@ " , infoDict[@" CFBundleIdentifier" ],
170- infoDict[@" CFBundleShortVersionString" ], infoDict[@" CFBundleVersion" ]];
171- }
172-
173- NSRegularExpression *everythingAllowedRegex =
174- [NSRegularExpression regularExpressionWithPattern: @" .*"
175- options: NSRegularExpressionCaseInsensitive
176- error: NULL ];
177- self.tracePropagationTargets = @[ everythingAllowedRegex ];
178- self.failedRequestTargets = @[ everythingAllowedRegex ];
179-
180- // defaults to 500 to 599
181- SentryHttpStatusCodeRange *defaultHttpStatusCodeRange =
182- [[SentryHttpStatusCodeRange alloc ] initWithMin: 500 max: 599 ];
183- self.failedRequestStatusCodes = @[ defaultHttpStatusCodeRange ];
184-
185- self.cacheDirectoryPath
186- = NSSearchPathForDirectoriesInDomains (NSCachesDirectory, NSUserDomainMask, YES )
187- .firstObject
188- ?: @" " ;
189129
190130#if SENTRY_HAS_METRIC_KIT
191131 self.enableMetricKit = NO ;
@@ -195,77 +135,6 @@ - (instancetype)init
195135 return self;
196136}
197137
198- - (void )setTracePropagationTargets : (NSArray *)tracePropagationTargets
199- {
200- for (id targetCheck in tracePropagationTargets) {
201- if (![targetCheck isKindOfClass: [NSRegularExpression class ]]
202- && ![targetCheck isKindOfClass: [NSString class ]]) {
203- SENTRY_LOG_WARN (@" Only instances of NSString and NSRegularExpression are supported "
204- @" inside tracePropagationTargets." );
205- }
206- }
207-
208- _tracePropagationTargets = tracePropagationTargets;
209- }
210-
211- - (void )setFailedRequestTargets : (NSArray *)failedRequestTargets
212- {
213- for (id targetCheck in failedRequestTargets) {
214- if (![targetCheck isKindOfClass: [NSRegularExpression class ]]
215- && ![targetCheck isKindOfClass: [NSString class ]]) {
216- SENTRY_LOG_WARN (@" Only instances of NSString and NSRegularExpression are supported "
217- @" inside failedRequestTargets." );
218- }
219- }
220-
221- _failedRequestTargets = failedRequestTargets;
222- }
223-
224- - (void )setDsn : (NSString *)dsn
225- {
226- NSError *error = nil ;
227- self.parsedDsn = [[SentryDsn alloc ] initWithString: dsn didFailWithError: &error];
228-
229- if (error == nil ) {
230- _dsn = dsn;
231- } else {
232- SENTRY_LOG_ERROR (@" Could not parse the DSN: %@ ." , error);
233- }
234- }
235-
236- - (void )setSampleRate : (NSNumber *)sampleRate
237- {
238- if (sampleRate == nil ) {
239- _sampleRate = nil ;
240- } else if (sentry_isValidSampleRate (sampleRate)) {
241- _sampleRate = sampleRate;
242- } else {
243- _sampleRate = SENTRY_DEFAULT_SAMPLE_RATE;
244- }
245- }
246-
247- - (void )setTracesSampleRate : (NSNumber *)tracesSampleRate
248- {
249- if (tracesSampleRate == nil ) {
250- _tracesSampleRate = nil ;
251- } else if (sentry_isValidSampleRate (tracesSampleRate)) {
252- _tracesSampleRate = tracesSampleRate;
253- } else {
254- _tracesSampleRate = SENTRY_DEFAULT_TRACES_SAMPLE_RATE;
255- }
256- }
257-
258- - (void )setEnableSpotlight : (BOOL )value
259- {
260- _enableSpotlight = value;
261- #if defined(RELEASE)
262- if (value) {
263- SENTRY_LOG_WARN (@" Enabling Spotlight for a release build. We recommend running Spotlight "
264- @" only for local development." );
265- }
266- #endif // defined(RELEASE)
267- }
268-
269138#if defined(DEBUG) || defined(SENTRY_TEST) || defined(SENTRY_TEST_CI)
270139- (NSString *)debugDescription
271140{
0 commit comments