Skip to content

Commit 532f33c

Browse files
fix: Convert bools to Swift in Options code docs (#6922)
The options frequently mentioned YES and NO, but this is Swift code now and should be true and false.
1 parent 9859629 commit 532f33c

File tree

2 files changed

+46
-45
lines changed

2 files changed

+46
-45
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- Fix UIWindow being possibly accessed from a background thread in SentryCrashWrapper (#6905)
1616
- Ensure SentrySDK.close resets everything on the main thread (#6907)
1717
- Allow transaction tags to be accessed and modified in `beforeSend` (#6910)
18+
- Convert bools to Swift in Options code docs (#6922)
1819

1920
## 9.0.0-rc.1
2021

Sources/Swift/Options.swift

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
/// Turns debug mode on or off. If debug is enabled SDK will attempt to print out useful debugging
3737
/// information if something goes wrong.
38-
/// @note Default is NO.
38+
/// @note Default is @c false.
3939
@objc public var debug: Bool = false
4040

4141
/// Minimum LogLevel to be used if debug is enabled.
@@ -58,8 +58,8 @@
5858
/// @note Default value is "production".
5959
@objc public var environment: String = Options.defaultEnvironment
6060

61-
/// Specifies whether this SDK should send events to Sentry. If set to NO events will be
62-
/// dropped in the client and not sent to Sentry. Default is YES.
61+
/// Specifies whether this SDK should send events to Sentry. If set to @c false events will be
62+
/// dropped in the client and not sent to Sentry. Default is @c true.
6363
@objc public var enabled = true
6464

6565
/// Controls the flush duration when calling SentrySDK/close.
@@ -69,7 +69,7 @@
6969
/// @note Disabling this feature disables the SentryWatchdogTerminationTrackingIntegration,
7070
/// because SentryWatchdogTerminationTrackingIntegration would falsely report every crash as watchdog
7171
/// termination.
72-
/// @note Default value is YES.
72+
/// @note Default value is @c true.
7373
/// @note Crash reporting is automatically disabled if a debugger is attached.
7474
@objc public var enableCrashHandler: Bool = true
7575

@@ -86,7 +86,7 @@
8686
/// feature or use the `SentryCrashExceptionApplication`. Having both enabled can lead to duplicated
8787
/// reports.
8888
///
89-
/// @note Default value is NO.
89+
/// @note Default value is @c false.
9090
@objc public var enableUncaughtNSExceptionReporting: Bool = false
9191
#endif
9292

@@ -99,7 +99,7 @@
9999
/// aware that their app can receive a SIGTERM in various scenarios, such as CPU or disk overuse,
100100
/// watchdog terminations, or when the OS updates your app.
101101
///
102-
/// @note The default value is NO.
102+
/// @note The default value is @c false.
103103
@objc public var enableSigtermReporting: Bool = false
104104
#endif
105105

@@ -111,7 +111,7 @@
111111
/// disabling enableSwizzling also disables this feature.
112112
/// @discussion If you want to enable or disable network tracking for performance monitoring, please
113113
/// use enableNetworkTracking instead.
114-
/// @note Default value is YES.
114+
/// @note Default value is @c true.
115115
@objc public var enableNetworkBreadcrumbs: Bool = true
116116

117117
/// The maximum number of envelopes to keep in cache.
@@ -127,7 +127,7 @@
127127

128128
/// When enabled, the SDK sends logs to Sentry. Logs can be captured using the SentrySDK.logger
129129
/// API, which provides structured logging with attributes.
130-
/// @note Default value is NO.
130+
/// @note Default value is @c false.
131131
@objc public var enableLogs: Bool = false
132132

133133
/// Use this callback to drop or modify a log before the SDK sends it to Sentry. Return nil to
@@ -137,13 +137,13 @@
137137
/// This block can be used to modify the breadcrumb before it will be serialized and sent.
138138
@objc public var beforeBreadcrumb: SentryBeforeBreadcrumbCallback?
139139

140-
/// You can use this callback to decide if the SDK should capture a screenshot or not. Return true
141-
/// if the SDK should capture a screenshot, return false if not. This callback doesn't work for
140+
/// You can use this callback to decide if the SDK should capture a screenshot or not. Return @c true
141+
/// if the SDK should capture a screenshot, return @c false if not. This callback doesn't work for
142142
/// crashes.
143143
@objc public var beforeCaptureScreenshot: SentryBeforeCaptureScreenshotCallback?
144144

145145
/// You can use this callback to decide if the SDK should capture a view hierarchy or not. Return
146-
/// true if the SDK should capture a view hierarchy, return false if not. This callback doesn't
146+
/// @c true if the SDK should capture a view hierarchy, return @c false if not. This callback doesn't
147147
/// work for crashes.
148148
@objc public var beforeCaptureViewHierarchy: SentryBeforeCaptureScreenshotCallback?
149149

@@ -182,17 +182,17 @@
182182
var _sampleRate: NSNumber? = 1
183183

184184
/// Whether to enable automatic session tracking or not.
185-
/// @note Default is YES.
185+
/// @note Default is @c true.
186186
@objc public var enableAutoSessionTracking: Bool = true
187187

188188
/// Whether to attach the top level `operationName` node of HTTP json requests to HTTP breadcrumbs
189-
/// @note Default is NO.
189+
/// @note Default is @c false.
190190
@objc public var enableGraphQLOperationTracking: Bool = false
191191

192192
/// Whether to enable Watchdog Termination tracking or not.
193193
/// @note This feature requires the SentryCrashIntegration being enabled, otherwise it would
194194
/// falsely report every crash as watchdog termination.
195-
/// @note Default is YES.
195+
/// @note Default is @c true.
196196
@objc public var enableWatchdogTerminationTracking: Bool = true
197197

198198
/// The interval to end a session after the App goes to the background.
@@ -213,8 +213,8 @@
213213
@objc public var maxAttachmentSize: UInt = 200 * 1_024 * 1_024
214214

215215
/// When enabled, the SDK sends personal identifiable along with events.
216-
/// @note The default is NO.
217-
/// @discussion When the user of an event doesn't contain an IP address, and this flag is YES, the
216+
/// @note The default is @c false.
217+
/// @discussion When the user of an event doesn't contain an IP address, and this flag is @c true, the
218218
/// SDK sets sdk.settings.infer_ip to auto to instruct the server to use the connection IP address as
219219
/// the user address. Due to backward compatibility concerns, Sentry sets sdk.settings.infer_ip to
220220
/// auto out of the box for Cocoa. If you want to stop Sentry from using the connections IP address,
@@ -223,7 +223,7 @@
223223

224224
/// When enabled, the SDK tracks performance for UIViewController subclasses and HTTP requests
225225
/// automatically. It also measures the app start and slow and frozen frames.
226-
/// @note The default is YES.
226+
/// @note The default is @c true.
227227
/// @note Performance Monitoring must be enabled for this flag to take effect. See:
228228
/// https://docs.sentry.io/platforms/apple/performance/
229229
@objc public var enableAutoPerformanceTracing: Bool = true
@@ -234,7 +234,7 @@
234234
/// crash event when your app crashes. The SDK skips adding profiles to increase the chance of
235235
/// keeping the transaction.
236236
///
237-
/// @note The default is NO.
237+
/// @note The default is @c false.
238238
@objc public var enablePersistingTracesWhenCrashing: Bool = false
239239

240240
/// A block that configures the initial scope when starting the SDK.
@@ -248,13 +248,13 @@
248248
/// When enabled, the SDK tracks performance for UIViewController subclasses.
249249
/// @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit
250250
/// configurations even when targeting iOS or tvOS platforms.
251-
/// @note The default is @c YES .
251+
/// @note The default is @c true.
252252
@objc public var enableUIViewControllerTracing: Bool = true
253253

254254
/// Automatically attaches a screenshot when capturing an error or exception.
255255
/// @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit
256256
/// configurations even when targeting iOS or tvOS platforms.
257-
/// @note Default value is @c NO .
257+
/// @note Default value is @c false.
258258
@objc public var attachScreenshot: Bool = false
259259

260260
/// Settings to configure screenshot attachments.
@@ -265,21 +265,21 @@
265265
/// error event.
266266
/// @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit
267267
/// configurations even when targeting iOS or tvOS platforms.
268-
/// @note Default value is @c NO .
268+
/// @note Default value is @c false.
269269
@objc public var attachViewHierarchy: Bool = false
270270

271271
/// @brief If enabled, view hierarchy attachment will contain view `accessibilityIdentifier`.
272-
/// Set it to @c NO if your project uses `accessibilityIdentifier` for PII.
272+
/// Set it to @c false if your project uses `accessibilityIdentifier` for PII.
273273
/// @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit
274274
/// configurations even when targeting iOS or tvOS platforms.
275-
/// @note Default value is @c YES.
275+
/// @note Default value is @c true.
276276
@objc public var reportAccessibilityIdentifier: Bool = true
277277

278278
/// When enabled, the SDK creates transactions for UI events like buttons clicks, switch toggles,
279279
/// and other ui elements that uses UIControl @c sendAction:to:forEvent:
280280
/// @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit
281281
/// configurations even when targeting iOS or tvOS platforms.
282-
/// @note Default value is @c YES .
282+
/// @note Default value is @c true.
283283
@objc public var enableUserInteractionTracing: Bool = true
284284

285285
/// How long an idle transaction waits for new children after all its child spans finished. Only UI
@@ -300,13 +300,13 @@
300300
/// @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit
301301
/// configurations even when targeting iOS or tvOS platforms.
302302
///
303-
/// @note Default value is @c YES .
303+
/// @note Default value is @c true.
304304
@objc public var enablePreWarmedAppStartTracing: Bool = true
305305

306306
/// When enabled the SDK reports non-fully-blocking app hangs. A non-fully-blocking app hang is when
307307
/// the app appears stuck to the user but can still render a few frames.
308308
///
309-
/// @note The default is @c YES.
309+
/// @note The default is @c true.
310310
@objc public var enableReportNonFullyBlockingAppHangs: Bool = true
311311

312312
@_spi(Private) @objc public func isAppHangTrackingDisabled() -> Bool {
@@ -323,24 +323,24 @@
323323

324324
/// When enabled, the SDK tracks performance for HTTP requests if auto performance tracking and
325325
/// @c enableSwizzling are enabled.
326-
/// @note The default is @c YES .
326+
/// @note The default is @c true.
327327
/// @discussion If you want to enable or disable network breadcrumbs, please use
328328
/// @c enableNetworkBreadcrumbs instead.
329329
@objc public var enableNetworkTracking: Bool = true
330330

331331
/// When enabled, the SDK tracks performance for file IO reads and writes with NSData if auto
332332
/// performance tracking and enableSwizzling are enabled.
333-
/// @note The default is @c YES .
333+
/// @note The default is @c true.
334334
@objc public var enableFileIOTracing: Bool = true
335335

336336
/// When enabled, the SDK tracks performance for file IO reads and writes with NSData if auto
337337
/// performance tracking and enableSwizzling are enabled.
338-
/// @note The default is @c YES .
338+
/// @note The default is @c true.
339339
@objc public var enableDataSwizzling: Bool = true
340340

341341
/// When enabled, the SDK tracks performance for file IO operations with NSFileManager if auto
342342
/// performance tracking and enableSwizzling are enabled.
343-
/// @note The default is @c NO .
343+
/// @note The default is @c false.
344344
@objc public var enableFileManagerSwizzling: Bool = false
345345

346346
/// Indicates the percentage of the tracing data that is collected.
@@ -375,8 +375,8 @@
375375
@objc public var tracesSampler: SentryTracesSamplerCallback?
376376

377377
/// If tracing is enabled or not.
378-
/// @discussion @c YES if @c tracesSampleRateis > @c 0 and \<= @c 1
379-
/// or a @c tracesSampler is set, otherwise @c NO.
378+
/// @discussion @c true if @c tracesSampleRate is > @c 0 and \<= @c 1
379+
/// or a @c tracesSampler is set, otherwise @c false.
380380
@objc public var isTracingEnabled: Bool {
381381
(tracesSampleRate?.doubleValue ?? 0) > 0 && (tracesSampleRate?.doubleValue ?? 0) <= 1 || tracesSampler != nil
382382
}
@@ -410,7 +410,7 @@
410410
/// navigation with UIViewControllers, automatic instrumentation for UIViewControllers,
411411
/// automatic instrumentation for HTTP requests, automatic instrumentation for file IO with
412412
/// NSData, and automatically added sentry-trace header to HTTP requests for distributed tracing.
413-
/// Default is true.
413+
/// Default is @c true.
414414
@objc public var enableSwizzling: Bool = true
415415

416416
/// A set of class names to ignore for swizzling.
@@ -421,7 +421,7 @@
421421
@objc public var swizzleClassNameExcludes: Set<String> = []
422422

423423
/// When enabled, the SDK tracks the performance of Core Data operations. It requires enabling
424-
/// performance monitoring. The default is true.
424+
/// performance monitoring. The default is @c true.
425425
/// See: https://docs.sentry.io/platforms/apple/performance/
426426
@objc public var enableCoreDataTracing: Bool = true
427427

@@ -454,7 +454,7 @@
454454
#endif // SENTRY_TARGET_PROFILING_SUPPORTED
455455

456456
/// Whether to send client reports, which contain statistics about discarded events.
457-
/// @note The default is @c YES.
457+
/// @note The default is @c true.
458458
/// @see <https://develop.sentry.dev/sdk/client-reports/>
459459
@objc public var sendClientReports: Bool = true
460460

@@ -472,7 +472,7 @@
472472
///
473473
/// You can use @c enableReportNonFullyBlockingAppHangs to ignore non-fully-blocking app hangs.
474474
///
475-
/// @note The default is @c YES
475+
/// @note The default is @c true.
476476
/// @note App Hang tracking is automatically disabled if a debugger is attached.
477477
@objc public var enableAppHangTracking: Bool = true
478478

@@ -484,17 +484,17 @@
484484
@objc public var appHangTimeoutInterval: TimeInterval = 2.0
485485

486486
/// When enabled, the SDK adds breadcrumbs for various system events.
487-
/// @note Default value is @c YES.
487+
/// @note Default value is @c true.
488488
@objc public var enableAutoBreadcrumbTracking: Bool = true
489489

490490
/// When enabled, the SDK propagates the W3C Trace Context HTTP header traceparent on outgoing HTTP
491491
/// requests.
492492
///
493493
/// @discussion This is useful when the receiving services only support OTel/W3C propagation. The
494-
/// traceparent header is only sent when this option is @c YES and the request matches @c
494+
/// traceparent header is only sent when this option is @c true and the request matches @c
495495
/// tracePropagationTargets.
496496
///
497-
/// @note Default value is @c NO.
497+
/// @note Default value is @c false.
498498
@objc public var enablePropagateTraceparent: Bool = false
499499

500500
static let everythingAllowedRegex = try? NSRegularExpression(pattern: ".*", options: .caseInsensitive)
@@ -518,7 +518,7 @@
518518

519519
/// When enabled, the SDK captures HTTP Client errors.
520520
/// @note This feature requires @c enableSwizzling enabled as well.
521-
/// @note Default value is @c YES.
521+
/// @note Default value is @c true.
522522
@objc public var enableCaptureFailedRequests: Bool = true
523523

524524
/// The SDK will only capture HTTP Client errors if the HTTP Response status code is within the
@@ -558,7 +558,7 @@
558558
/// When enabled, the SDK adds the raw MXDiagnosticPayloads as an attachment to the converted
559559
/// SentryEvent. You need to enable @c enableMetricKit for this flag to work.
560560
///
561-
/// @note Default value is @c NO.
561+
/// @note Default value is @c false.
562562
@objc public var enableMetricKitRawPayload = false
563563

564564
#endif
@@ -570,28 +570,28 @@
570570
/// If @c SentrySDK.reportFullyDisplayed() is not called, the transaction will finish
571571
/// automatically after 30 seconds and the `Time to full display` Span will be
572572
/// finished with @c DeadlineExceeded status.
573-
/// @note Default value is `NO`.
573+
/// @note Default value is `false`.
574574
@objc public var enableTimeToFullDisplayTracing: Bool = false
575575

576576
/// This feature is only available from Xcode 13 and from macOS 12.0, iOS 15.0, tvOS 15.0,
577577
/// watchOS 8.0.
578578
///
579579
/// @warning This is an experimental feature and may still have bugs.
580580
/// @brief Stitches the call to Swift Async functions in one consecutive stack trace.
581-
/// @note Default value is @c NO .
581+
/// @note Default value is @c false.
582582
@objc public var swiftAsyncStacktraces: Bool = false
583583

584584
/// The path to store SDK data, like events, transactions, profiles, raw crash data, etc. We
585585
/// recommend only changing this when the default, e.g., in security environments, can't be accessed.
586586
///
587587
/// @note The default is `NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask,
588-
/// YES)`.
588+
/// true)`.
589589
@objc public var cacheDirectoryPath: String = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true).first ?? ""
590590

591591
/// Whether to enable Spotlight for local development. For more information see
592592
/// https://spotlightjs.com/.
593593
///
594-
/// @note Only set this option to @c YES while developing, not in production!
594+
/// @note Only set this option to @c true while developing, not in production!
595595
@objc public var enableSpotlight: Bool = false {
596596
didSet {
597597
#if !DEBUG

0 commit comments

Comments
 (0)